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.Implement Bootstrap Modal Popup Dialog Box inside Master Page in ASP.Net<p>Hi nadeem1218,</p> <p>i can see many missing things in your code.</p> <ol style="list-style-type: undefined;"> <li>Script is placed inside ContentPlaceHolder on Master page.</li> <li>Bootstrap and jquery both js missing.</li> <li>two title tag in head of master.</li> <li>ShowPopup Javascript function missing.</li> </ol> <p>However i have corrected all the things in below sample code. please refer it, it works.</p> <p>MASTER PAGE:</p> <pre class="brush: html">&lt;head runat=&#34;server&#34;&gt; &lt;title&gt;&lt;/title&gt; &lt;meta charset=&#34;utf-8&#34;&gt; &lt;meta http-equiv=&#34;X-UA-Compatible&#34; content=&#34;IE=edge&#34;&gt; &lt;meta name=&#34;viewport&#34; content=&#34;width=device-width, initial-scale=1&#34;&gt; &lt;!-- Bootstrap --&gt; &lt;link href=&#34;http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css&#34; rel=&#34;stylesheet&#34;&gt; &lt;script src=&#34;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js&#34; type=&#34;text/javascript&#34;&gt;&lt;/script&gt; &lt;script src=&#34;http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js&#34; type=&#34;text/javascript&#34;&gt;&lt;/script&gt; &lt;script src=&#34;http://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js&#34;&gt;&lt;/script&gt; &lt;script src=&#34;http://oss.maxcdn.com/respond/1.4.2/respond.min.js&#34;&gt;&lt;/script&gt; &lt;asp:ContentPlaceHolder ID=&#34;head&#34; runat=&#34;server&#34;&gt; &lt;/asp:ContentPlaceHolder&gt; &lt;script type=&#34;text/javascript&#34;&gt; function ShowPopup() { $(&#34;[id*=btnShowPopup]&#34;).click(); } &lt;/script&gt; &lt;style&gt; .modal-backdrop { height: 100%; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form runat=&#34;server&#34;&gt; &lt;asp:ContentPlaceHolder ID=&#34;MainContent&#34; runat=&#34;server&#34; /&gt; &lt;/form&gt; &lt;/body&gt;</pre> <p>aspx Page:</p> <pre class="brush: csharp">&lt;asp:Content ID=&#34;HeaderContent&#34; runat=&#34;server&#34; ContentPlaceHolderID=&#34;head&#34;&gt; &lt;/asp:Content&gt; &lt;asp:Content ID=&#34;BodyContent&#34; runat=&#34;server&#34; ContentPlaceHolderID=&#34;MainContent&#34;&gt; &lt;asp:ScriptManager ID=&#34;ScriptManager1&#34; runat=&#34;server&#34;&gt; &lt;/asp:ScriptManager&gt; &lt;asp:UpdatePanel ID=&#34;UpdatePanel1&#34; runat=&#34;server&#34;&gt; &lt;ContentTemplate&gt; &lt;div class=&#34;modal fade&#34; id=&#34;myModal&#34; style=&#34;display: none&#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 type=&#34;button&#34; class=&#34;close&#34; data-dismiss=&#34;modal&#34; aria-label=&#34;Close&#34;&gt; &lt;span aria-hidden=&#34;true&#34;&gt;&amp;times;&lt;/span&gt;&lt;/button&gt; &lt;h4 class=&#34;modal-title&#34;&gt; Registration done Successfully&lt;/h4&gt; &lt;/div&gt; &lt;div class=&#34;modal-body&#34;&gt; Test Modal &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;button type=&#34;button&#34; class=&#34;btn btn-primary&#34;&gt; Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;asp:Button runat=&#34;server&#34; ID=&#34;btnShowPopup&#34; Text=&#34;Test Show&#34; OnClick=&#34;btn_click&#34; CssClass=&#34;btn btn-primary&#34; data-toggle=&#34;modal&#34; data-target=&#34;#myModal&#34; /&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;/asp:Content&gt;</pre> <p>Code Behind:</p> <pre class="brush: csharp">protected void btn_click(object sender, EventArgs e) { ClientScript.RegisterStartupScript(this.GetType(), &#34;alert&#34;, &#34;ShowPopup();&#34;, true); }</pre> <p>Thanks</p>https://www.aspforums.net:443/Threads/251349/Implement-Bootstrap-Modal-Popup-Dialog-Box-inside-Master-Page-in-ASPNet/https://www.aspforums.net:443/Threads/251349/Implement-Bootstrap-Modal-Popup-Dialog-Box-inside-Master-Page-in-ASPNet/Thu, 17 Dec 2015 05:10:14 GMT