ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2019 www.aspforums.com. All rights reserved.Display Ajax ModalPopupExtender after PostBack in ASP.Net<p>Hi <a class="username" rel="sambath"> sambath</a>,</p> <p>I have checked the code its working. On Generate OTP Button click modal popup is reopening.</p> <p>Refer the below code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;script type=&#34;text/javascript&#34; src=&#34;http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js&#34;&gt;&lt;/script&gt; &lt;link rel=&#34;stylesheet&#34; href=&#34;http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css&#34; /&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(document).on(&#34;click&#34;, &#34;.menu&#34;, function () { $find(&#34;mpesubmit&#34;).show(); return false; }) &lt;/script&gt; &lt;ajax:ToolkitScriptManager ID=&#34;ToolkitScriptManager1&#34; runat=&#34;server&#34;&gt; &lt;/ajax:ToolkitScriptManager&gt; &lt;asp:Button Text=&#34;Open&#34; CssClass=&#34;menu&#34; runat=&#34;server&#34; /&gt; &lt;div id=&#34;myModal&#34; role=&#34;dialog&#34; data-backdrop=&#34;static&#34; data-keyboard=&#34;false&#34;&gt; &lt;div class=&#34;modal-dialog&#34;&gt; &lt;div class=&#34;modal-content&#34;&gt; &lt;div class=&#34;modal-header&#34;&gt; &lt;button id=&#34;btnclose&#34; type=&#34;button&#34; class=&#34;close&#34; data-dismiss=&#34;modal&#34; aria-disabled=&#34;false&#34; aria-hidden=&#34;true&#34;&gt; &amp;times;&lt;/button&gt; &lt;h1 class=&#34;modal-title panel-title&#34; id=&#34;Modalsearch&#34;&gt; &lt;b&gt; &lt;center&gt; Contact&lt;/center&gt; &lt;/b&gt; &lt;/h1&gt; &lt;/div&gt; &lt;div class=&#34;modal-body&#34;&gt; &lt;center&gt; &lt;asp:TextBox ID=&#34;txtname&#34; CssClass=&#34;form-control&#34; Width=&#34;300&#34; placeholder=&#34;Your Name&#34; CausesValidation=&#34;true&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt; &lt;asp:RequiredFieldValidator ID=&#34;RequiredFieldValidator1&#34; ControlToValidate=&#34;txtname&#34; ValidationGroup=&#34;NeededForValidate&#34; runat=&#34;server&#34; ErrorMessage=&#34;*&#34;&gt;&lt;/asp:RequiredFieldValidator&gt;&lt;br /&gt; &lt;asp:TextBox ID=&#34;txtemail&#34; CssClass=&#34;form-control&#34; Width=&#34;300&#34; placeholder=&#34;Your Email&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt; &lt;asp:RegularExpressionValidator ID=&#34;RegularExpressionValidator5&#34; runat=&#34;server&#34; ErrorMessage=&#34;*&#34; ValidationGroup=&#34;NeededForValidate&#34; ControlToValidate=&#34;txtemail&#34; ValidationExpression=&#34;\w+([-+.&#39;]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*&#34;&gt;&lt;/asp:RegularExpressionValidator&gt;&lt;br /&gt; &lt;asp:DropDownList ID=&#34;ddlcontent&#34; CssClass=&#34;form-control&#34; runat=&#34;server&#34; Width=&#34;300&#34;&gt; &lt;asp:ListItem Value=&#34;post&#34;&gt;Select Plan&lt;/asp:ListItem&gt; &lt;asp:ListItem Value=&#34;post&#34;&gt;PostPaid&lt;/asp:ListItem&gt; &lt;asp:ListItem Value=&#34;brwl&#34;&gt;Broadband with LandLine&lt;/asp:ListItem&gt; &lt;asp:ListItem Value=&#34;brwol&#34;&gt;Broadband without LandLine&lt;/asp:ListItem&gt; &lt;asp:ListItem Value=&#34;ILL&#34;&gt;ILL&lt;/asp:ListItem&gt; &lt;asp:ListItem Value=&#34;tollfree&#34;&gt;Tollfree Nos&lt;/asp:ListItem&gt; &lt;asp:ListItem Value=&#34;PRI&#34;&gt;PRI&lt;/asp:ListItem&gt; &lt;/asp:DropDownList&gt; &lt;br /&gt; &lt;asp:TextBox ID=&#34;txtcity&#34; CssClass=&#34;form-control&#34; Width=&#34;300&#34; placeholder=&#34;City&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt;&lt;br /&gt; &lt;asp:TextBox ID=&#34;txtmob&#34; CssClass=&#34;form-control&#34; Width=&#34;300&#34; MaxLength=&#34;10&#34; onkeypress=&#34;return isNumberKey(event)&#34; placeholder=&#34;Your Contact Nunmber&#34; CausesValidation=&#34;true&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt; &lt;asp:RequiredFieldValidator ID=&#34;RequiredFieldValidator2&#34; ControlToValidate=&#34;txtmob&#34; runat=&#34;server&#34; ValidationGroup=&#34;NeededForValidate&#34; ErrorMessage=&#34;*&#34;&gt;&lt;/asp:RequiredFieldValidator&gt;&lt;br /&gt; &lt;br /&gt; &lt;asp:Button ID=&#34;btnsubmit&#34; class=&#34;btn btn-warning&#34; OnClick=&#34;btnsubmit_Click&#34; ValidationGroup=&#34;NeededForValidate&#34; runat=&#34;server&#34; Text=&#34;Generate OTP&#34; /&gt;&lt;br /&gt; &lt;asp:TextBox ID=&#34;txtOTP&#34; class=&#34;btn&#34; MaxLength=&#34;4&#34; Width=&#34;100&#34; onkeyup=&#34;return Check()&#34; Visible=&#34;false&#34; placeholder=&#34;Enter OTP&#34; runat=&#34;server&#34;&gt;&lt;/asp:TextBox&gt; &lt;asp:Button ID=&#34;btnok&#34; class=&#34;btn btn-success&#34; Visible=&#34;false&#34; OnClick=&#34;btnok_Click&#34; runat=&#34;server&#34; Text=&#34;Confirm&#34; /&gt; &lt;asp:Label ID=&#34;lblMessage&#34; runat=&#34;server&#34; Text=&#34;&#34;&gt;&lt;/asp:Label&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;asp:LinkButton ID=&#34;BTNDummy&#34; runat=&#34;server&#34;&gt;&lt;/asp:LinkButton&gt; &lt;ajax:ModalPopupExtender ID=&#34;mpesubmit&#34; runat=&#34;server&#34; TargetControlID=&#34;btnDummy&#34; PopupControlID=&#34;myModal&#34; BackgroundCssClass=&#34;modalBackground&#34;&gt; &lt;/ajax:ModalPopupExtender&gt;</pre> <p><strong><span style="text-decoration: underline;">C#</span></strong></p> <pre class="brush: csharp">protected void btnok_Click(object sender, EventArgs e) { } protected void btnsubmit_Click(object sender, EventArgs e) { mpesubmit.Show(); }</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><img src="https://imgur.com/YpsxkaG.gif" alt="" width="396" height="489" /></p>https://www.aspforums.net:443/Threads/775628/Display-Ajax-ModalPopupExtender-after-PostBack-in-ASPNet/https://www.aspforums.net:443/Threads/775628/Display-Ajax-ModalPopupExtender-after-PostBack-in-ASPNet/Wed, 24 Oct 2018 00:41:48 GMT