I m trying to use jquery validation plugin but my form is in update panel. So even after applying the validation on submit the form it validates and shows the required message for hardly 2 seconds and then submits the form.
What is the workaround for this?
I have tried this also.
<asp:UpdatePanel ID="AddUserPanel" runat="server"
ChildrenAsTriggers="false"
UpdateMode="Conditional">
But this also doesn't seem to help.
If your using a script manager you need the l33t code below:
$(function () {
//Code that runs before update panel is fired.
//Listen for update panel
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
//Re-initialize jquery after an auto post back.
function EndRequestHandler(sender, args) {
//Do work after update panel fires.
}
});
So basically you have duplicate code, code outside of the EndRequestHandler() and inside it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With