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.Bootstrap Modal Popup not opening on LinkButton Click from code behind in ASP.Net<p>Hi&nbsp;<a class="username" rel="AbdulHaque">AbdulHaque,</a></p> <p>I have checked. Your code is working.</p> <p>Check with below sample 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; function openModal() { $(&#39;[id*=myModal]&#39;).modal(&#39;show&#39;); } &lt;/script&gt; &lt;div&gt; &lt;div id=&#34;myModal&#34; class=&#34;modal fade&#34; role=&#34;dialog&#34;&gt; &lt;div class=&#34;modal-dialog&#34;&gt; &lt;!-- Modal content--&gt; &lt;div class=&#34;modal-content&#34;&gt; &lt;div class=&#34;modal-header&#34;&gt; &lt;button type=&#34;button&#34; class=&#34;close&#34; data-dismiss=&#34;modal&#34;&gt; &amp;times;&lt;/button&gt; &lt;h4 class=&#34;modal-title&#34;&gt; Modal Header&lt;/h4&gt; &lt;/div&gt; &lt;div class=&#34;modal-body&#34;&gt; &lt;iframe id=&#34;Iframe1&#34; runat=&#34;server&#34;&gt;&lt;/iframe&gt; &lt;/div&gt; &lt;div class=&#34;modal-footer&#34;&gt; &lt;button type=&#34;button&#34; class=&#34;btn btn-default&#34; data-dismiss=&#34;modal&#34;&gt; Close&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class=&#34;panel panel-default&#34;&gt; &lt;div class=&#34;panel-heading&#34;&gt; &lt;b&gt;ADM Details&lt;/b&gt; &lt;span style=&#34;float: right&#34; data-toggle=&#34;collapse&#34; data-target=&#34;#admDetails&#34; class=&#34;glyphicon glyphicon-minus&#34;&gt;&lt;/span&gt; &lt;asp:LinkButton ID=&#34;LinkButton1&#34; runat=&#34;server&#34; OnClick=&#34;lbADM_Click&#34;&gt;Edit&lt;/asp:LinkButton&gt; &lt;asp:LinkButton ID=&#34;LinkButton2&#34; runat=&#34;server&#34; data-toggle=&#34;modal&#34; data-target=&#34;#myModal&#34; OnClick=&#34;lbTechnical_Click&#34;&gt;EditTech&lt;/asp:LinkButton&gt; &lt;/div&gt; &lt;div class=&#34;panel-body collapse in&#34; id=&#34;admDetails&#34;&gt; &lt;div class=&#34;row&#34;&gt; &lt;div class=&#34;col-lg-4 col-md-4 col-sm-12&#34;&gt; &lt;asp:Label ID=&#34;lbAdmAppDate&#34; runat=&#34;server&#34; Text=&#34;ADM Approval&#34; CssClass=&#34;lbl1&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblAdmApprovalDate&#34; runat=&#34;server&#34; Text=&#34;-&#34; CssClass=&#34;lbl2&#34;&gt;&lt;/asp:Label&gt; &lt;/div&gt; &lt;div class=&#34;col-lg-4 col-md-4 col-sm-12&#34;&gt; &lt;asp:Label ID=&#34;lbAdmAmt&#34; runat=&#34;server&#34; Text=&#34;ADM Amount&#34; CssClass=&#34;lbl1&#34;&gt;&lt;/asp:Label&gt; &lt;asp:Label ID=&#34;lblAdmAmount&#34; runat=&#34;server&#34; Text=&#34;-&#34; CssClass=&#34;lbl2&#34;&gt;&lt;/asp:Label&gt; &lt;/div&gt; &lt;div class=&#34;col-lg-4 col-md-4 col-sm-12&#34;&gt; &lt;br style=&#34;line-height: 50px&#34; /&gt; &lt;asp:HyperLink runat=&#34;server&#34; ID=&#34;hplAdmDetails&#34; Text=&#34;Edit&#34; CssClass=&#34;hpl&#34; Visible=&#34;false&#34;&gt;&lt;/asp:HyperLink&gt; &lt;asp:LinkButton ID=&#34;lbADM&#34; runat=&#34;server&#34; Text=&#34;Edit&#34; CssClass=&#34;hpl&#34; OnClick=&#34;lbADM_Click&#34;&gt;Edit&lt;/asp:LinkButton&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</pre> <p><strong><span style="text-decoration: underline;">C#</span></strong></p> <pre class="brush: csharp">protected void lbADM_Click(object sender, EventArgs e) { Iframe1.Attributes.Add(&#34;src&#34;, &#34;AdmDetails.aspx&#34;); ScriptManager.RegisterStartupScript(this, this.GetType(), &#34;Pop&#34;, &#34;openModal();&#34;, true); } protected void lbTechnical_Click(object sender, EventArgs e) { Iframe1.Attributes.Add(&#34;src&#34;, &#34;AdmDetails.aspx&#34;); ScriptManager.RegisterStartupScript(this, this.GetType(), &#34;Pop&#34;, &#34;openModal();&#34;, true); }</pre> <p><strong><span style="text-decoration: underline;">VB.Net</span></strong></p> <pre class="brush: vb">Protected Sub lbADM_Click(ByVal sender As Object, ByVal e As EventArgs) Iframe1.Attributes.Add(&#34;src&#34;, &#34;AdmDetails.aspx&#34;) ScriptManager.RegisterStartupScript(Me, Me.GetType(), &#34;Pop&#34;, &#34;openModal();&#34;, True) End Sub Protected Sub lbTechnical_Click(ByVal sender As Object, ByVal e As EventArgs) Iframe1.Attributes.Add(&#34;src&#34;, &#34;AdmDetails.aspx&#34;) ScriptManager.RegisterStartupScript(Me, Me.GetType(), &#34;Pop&#34;, &#34;openModal();&#34;, True) End Sub</pre> <p><strong><span style="text-decoration: underline;">Screenshot</span></strong></p> <p><strong><span style="text-decoration: underline;"><img src="https://i.imgur.com/K2W2MvN.gif" alt="" width="387" height="380" /></span></strong></p>https://www.aspforums.net:443/Threads/908468/Bootstrap-Modal-Popup-not-opening-on-LinkButton-Click-from-code-behind-in-ASPNet/https://www.aspforums.net:443/Threads/908468/Bootstrap-Modal-Popup-not-opening-on-LinkButton-Click-from-code-behind-in-ASPNet/Fri, 07 Dec 2018 02:05:51 GMT