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.[Solved] Bootstrap DatePicker not working after PostBack inside ASP.Net UpdatePanel<p>All jQuery plugins are applied on the Page Load event of the HTML Page or in other words document ready event which is fired when the whole page or document is rendered completely in browser. Now jQuery assigns a unique identification to all controls when applying the plugin. But when some control is inside UpdatePanel and a Partial PostBack occurs the Unique Ids assigned by jQuery is lost and hence the plugin stops working.</p> <p>For more Information refer the below article link for your reference.</p> <h1><a href="https://www.aspsnippets.com/Articles/jQuery-DatePicker-not-working-inside-ASPNet-AJAX-UpdatePanel-Partial-PostBack.aspx">jQuery DatePicker not working inside ASP.Net AJAX UpdatePanel Partial PostBack</a></h1> <p>Also refer the below modified Sample code for your reference and implement it as per your code logic.</p> <p><span style="text-decoration: underline;"><strong>HTML</strong></span></p> <pre class="brush: html">&lt;html xmlns=&#34;http://www.w3.org/1999/xhtml&#34;&gt; &lt;head id=&#34;Head1&#34; runat=&#34;server&#34;&gt; &lt;title&gt;&lt;/title&gt; &lt;script src=&#34;http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.0.min.js&#34; type=&#34;text/javascript&#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;link rel=&#34;stylesheet&#34; href=&#34;https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.1/css/bootstrap-datepicker.css&#34; /&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.5.1/js/bootstrap-datepicker.min.js&#34;&gt;&lt;/script&gt; &lt;style type=&#34;text/css&#34;&gt; .table-condensed { width: 200px; height: 10px; font-size: 12px; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;form id=&#34;form1&#34; runat=&#34;server&#34;&gt; &lt;br /&gt; &lt;br /&gt; &lt;div&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;row&#34;&gt; &lt;div class=&#34;col-md-4&#34;&gt; &lt;div id=&#39;datepicker&#39; class=&#34;input-group date datepicker col-md-6&#34; data-date=&#34;&#34; data-link-field=&#34;dtp_input2&#34; style=&#34;max-width: 220px&#34;&gt; &lt;asp:TextBox ID=&#34;txtBookDate&#34; runat=&#34;server&#34; CssClass=&#34;form-control&#34; size=&#34;16&#34; type=&#34;text&#34; value=&#34;&#34; AutoPostBack=&#34;true&#34; OnTextChanged=&#34;txtBookDate_TextChanged&#34; /&gt; &lt;span class=&#34;input-group-addon&#34;&gt;&lt;span class=&#34;glyphicon glyphicon-calendar&#34;&gt;&lt;/span&gt; &lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt; &lt;/div&gt; &lt;script type=&#34;text/javascript&#34;&gt; //On Page Load. $(function () { SetDatePicker(); }); //On UpdatePanel Refresh. var prm = Sys.WebForms.PageRequestManager.getInstance(); if (prm != null) { prm.add_endRequest(function (sender, e) { if (sender._postBackSettings.panelsToUpdate != null) { SetDatePicker(); $(&#34;.datepicker-orient-bottom&#34;).hide(); } }); }; function SetDatePicker() { $(&#34;#datepicker&#34;).datepicker(); if ($(&#34;#txtBookDate&#34;).val() == &#34;&#34;) { var dateNow = new Date(); $(&#39;#datepicker&#39;).datepicker(&#34;setDate&#34;, dateNow); } } &lt;/script&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt;</pre> <p><span style="text-decoration: underline;"><strong>Screenshot</strong></span></p> <p><span style="text-decoration: underline;"><strong><img src="https://i.imgur.com/zftihO9.gif" alt="" width="217" height="264" /></strong></span></p> <p>&nbsp;</p>https://www.aspforums.net:443/Threads/179971/Solved-Bootstrap-DatePicker-not-working-after-PostBack-inside-ASPNet-UpdatePanel/https://www.aspforums.net:443/Threads/179971/Solved-Bootstrap-DatePicker-not-working-after-PostBack-inside-ASPNet-UpdatePanel/Mon, 11 Dec 2017 04:54:49 GMT