For some reason I'm using HTML controls with runat="server"
. One of these controls is a button. I have client-side validation function. I wan't to fire server-side action after successful client-side validation.
HTML:
<button type="button" id="webSubmit"
runat="server"
onclick="return $('#form1').valid();">Submit</button>
Server side:
protected void webSubmit_ServerClick(object sender, EventArgs e)
{
//foo
}
When I click the button it validates the form but does not postback even if validation returns true.
It's generated by ASP.net:
<button onclick="return $('#form1').valid(); __doPostBack('webSubmit','')"
id="webSubmit" type="button">Submit</button>