I have a piece of code
<div class="class1">
<span>testing</span>
</div>
I will change this into html server control.
<div class="class1" id="div1" runat="server">
<span>testing</span>
</div>
I want to add a click event.
<div class="class1" id="div1" runat="server" onclick="Test_Click">
<span>testing</span>
</div>
On code behind, I have that event handler.
protected void Test_Click(object sernder, EventArgs e)
{
//code
}
But it is not working.. I tried by changing onclick to onserverclick. it is still not working..
Any other way?
From your post I got that you want to simple go to the server side event while clicking the Div. You can't directly give this to a
DIV, instead you can use aHidden Buttonin the div and trigger theclickeventmanually.In _Default.aspx.cs
You can see the
jQueryImplementation over here: JQuery UI Dialog & Asp (web forms) calling event handler