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.Open (Show) Bootstrap Modal Popup after AJAX Call Success in ASP.Net<p>Hi <a class="username" rel="fr3eddy"> fr3eddy</a>,</p> <p>Refer below sample.</p> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <pre class="brush: html">&lt;script type=&#34;text/javascript&#34; src=&#39;https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js&#39;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#39;https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/js/bootstrap.min.js&#39;&gt;&lt;/script&gt; &lt;link rel=&#34;stylesheet&#34; href=&#39;https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.0.3/css/bootstrap.min.css&#39; media=&#34;screen&#34; /&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { $(&#34;#btnSubmit&#34;).click(function () { var body = $(&#39;[Id*=txtName]&#39;).val(); $(&#34;#MyPopup .modal-body&#34;).html(&#34;Welcome to &#34; + body); $.ajax({ type: &#34;POST&#34;, url: &#34;Default.aspx/SendParameters&#34;, data: &#34;{name: &#39;&#34; + $(&#34;#txtName&#34;).val() + &#34;&#39;}&#34;, contentType: &#34;application/json; charset=utf-8&#34;, dataType: &#34;json&#34;, success: function (r) { $(&#34;#MyPopup&#34;).modal(&#34;show&#34;); } }); }); $(&#34;#btnClosePopup&#34;).click(function () { $(&#34;#MyPopup&#34;).modal(&#34;hide&#34;); }); }); &lt;/script&gt; &lt;!-- Bootstrap --&gt; Name: &lt;br /&gt; &lt;input type=&#34;text&#34; id=&#34;txtName&#34; value=&#34;&#34; class=&#34;form-control&#34; /&gt; &lt;br /&gt; &lt;input type=&#34;button&#34; id=&#34;btnSubmit&#34; value=&#34;Submit&#34; class=&#34;btn btn-success&#34; /&gt; &lt;/br&gt; &lt;!-- Modal Popup --&gt; &lt;div id=&#34;MyPopup&#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; Greetings &lt;/h4&gt; &lt;/div&gt; &lt;div class=&#34;modal-body&#34;&gt; &lt;/div&gt; &lt;div class=&#34;modal-footer&#34;&gt; &lt;input type=&#34;button&#34; id=&#34;btnClosePopup&#34; value=&#34;Close&#34; class=&#34;btn btn-danger&#34; /&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;</pre> <p><span style="text-decoration: underline;"><strong>Code</strong></span></p> <p><strong>C#</strong></p> <pre class="brush: csharp">[System.Web.Services.WebMethod()] public static string SendParameters(string name) { return string.Format(&#34;Name: {0}&#34;, name); }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">&lt;System.Web.Services.WebMethod()&gt; Public Shared Function SendParameters(ByVal name As String) As String Return String.Format(&#34;Name: {0}&#34;, name) End Function</pre> <p><span style="text-decoration: underline;"><strong>Screenshot</strong></span></p> <p><img src="https://i.imgur.com/I4tO6SC.gif" alt="" width="259" height="334" /></p>https://www.aspforums.net:443/Threads/896061/Open-Show-Bootstrap-Modal-Popup-after-AJAX-Call-Success-in-ASPNet/https://www.aspforums.net:443/Threads/896061/Open-Show-Bootstrap-Modal-Popup-after-AJAX-Call-Success-in-ASPNet/Fri, 14 Jun 2019 01:19:48 GMT