Click here to Skip to main content
14,384,785 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have a ASP.NET FORM with Master page , and have placed the form controls inside the updatepanel and i am using Jquery - validation engine to validate the form controls . all working fine . but submit button is not triggering the postback event . I have tried all after googling many suggestion . but yet to get the solution for this issue . It would be great if any expert can help me to resolve this issue . Thanks in Advance . _ Martin

<asp:content id="Content1" contentplaceholderid="MainContent" runat="Server">
   <div class="col-xl-6 col-lg-6 col-md-6 col-sm-12 col-12 nopl ">
      <div class="login-form">
         <asp:updatepanel runat="server" id="usernameupdatepanel" updatemode="Conditional">
            <contenttemplate>
               <div class="form-group">
                  Full Name
                  <asp:textbox runat="server" id="txtFullName" cssclass="form-control validate[required]" placeholder="Full Name">
               </div>
               <div class="form-group">
                  Mobile Number
                  <asp:textbox runat="server" id="txtMobileNumber" cssclass="form-control validate[required,custom[integer],maxSize[10],minSize[10]]" placeholder="Mobile Number" onchange="CheckUserName(this)">
               </div>
               <div class="form-group">
                  Email
                  <asp:textbox runat="server" id="txtEmailID" cssclass="form-control validate[required,custom[email]]" placeholder="EMail - ID">
               </div>
               <div class="form-group">
                  <%----%>
                  <asp:textbox runat="server" id="password" name="password" cssclass="form-control validate[required]" clientidmode="Static" textmode="Password" placeholder="Password">
               </div>
               <div class="form-group">
                  <asp:textbox runat="server" id="confirm_password" name="confirm_password" textmode="Password" cssclass="form-control validate[required,equals[password]]" placeholder="Confirm Password">
               </div>
               <div class="form-group">
                  <asp:image id="imgCaptcha" runat="server" imageurl="~/CaptchaImage.aspx">
                  <br>
                  <asp:label runat="server" id="lblCaptchaMessage">
               </div>
               <div class="form-group">
                  <asp:textbox id="txtCaptchaText" runat="server" width="100px">
                  [Type Security code here]
               </div>
               <asp:hiddenfield id="hdnIpaddress" runat="server" clientidmode="Static">
               <asp:hiddenfield id="hdnCountry" runat="server" clientidmode="Static">
               <asp:hiddenfield id="hdnCity" runat="server" clientidmode="Static">
               <asp:button id="btnSubmit" runat="server" class="btn btn-default btn-block mb10" text="Submit" onclick="btnSubmit_Click">
               <asp:label id="lblMessage" runat="server">
 
               $(function () {
                  $("[id*=btnSubmit]").click(function () {
                     $("#AYform").validationEngine('attach', { promptPosition: "topRight", scroll: false });
                  });
                  var prm = Sys.WebForms.PageRequestManager.getInstance();
                  if (prm != null) {
                     prm.add_initializeRequest(function (sender, e) {
                        if (sender._postBackSettings.panelsToUpdate.join().indexOf("usernameupdatepanel") != -1) {
                           if (!$("[id*=usernameupdatepanel]").validationEngine('validate')) {
                              e.set_cancel(true);
                           }
                        }
                     });
                  };
               });


What I have tried:

I have tried changing all asyn trigger in asp.net webpage
Posted
Updated 5-Oct-19 4:55am
v2

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

I see a couple of problems with the code as presented.

1. Your jQuery is not within a script tag.
2. Your validation is looking for the form with the ID of "#AYform". That ID does not exist
   
Comments
Indexon India 5-Oct-19 10:24am
   
Yes it has been tested with script tag only . its a copy paste error . AYForm is in MasterPage ..
MadMyche 5-Oct-19 11:04am
   
I would suggest you start by looking at the generated HTML/javascipt and find the problem within it; and if needed then you fix the ASPX generating it

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100