In Asp.net I am using this JQuery validation plugin.
It works perfect for <asp:Button>
control. But if I use <asp:LinkButton>
it does not validate the form and allows it to call code behind method.
Why is this happening? How can I able to validate form onClick
event of <asp:LinkButton>
?
EDIT: The problem with <asp:button>
is we cannot able to add image on it. Check this.
The simple solution is to add a click function that returns false if the form is not valid:
more : ASP.NET LinkButton / ImageButton and JQuery Validate? Hope this will help !!!