ASPForums.Net RSS Feedhttp://www.aspforums.net/Handlers/RSS.ashxLatest additions to the content that appears on ASPForums.Net(c) 2017 www.aspforums.com. All rights reserved.Enable / Disable date in jQuery UI DatePicker based on Database date using jQuery AJAX in ASP.Net<p>Hi <a class="username" rel="amitj">amitj</a>,</p> <p>Refer the below link. This is with simple calendar control.</p> <p><input name="threadId" type="hidden" value="761917" /><a class="threadTitle" href="http://www.aspforums.net/Threads/761917/Disable-date-in-Calendar-Control-based-on-Database-date-using-C-in-ASPNet/"><span class="Highlight">Disable</span> <span class="Highlight">date</span> in Calendar Control based on <span class="Highlight">Database</span> <span class="Highlight">date</span> using C# in ASP.Net </a></p>http://www.aspforums.net/Threads/885327/Enable-Disable-date-in-jQuery-UI-DatePicker-based-on-Database-date-using-jQuery-AJAX-in-ASPNet/http://www.aspforums.net/Threads/885327/Enable-Disable-date-in-jQuery-UI-DatePicker-based-on-Database-date-using-jQuery-AJAX-in-ASPNet/Thu, 10 Nov 2016 01:48:29 GMTEnable / Disable date in jQuery UI DatePicker based on Database date using jQuery AJAX in ASP.Net<p>hello,</p> <p>but I want same in Jquery datepicker.i get date from Databse.</p> <p>Please help me.</p>http://www.aspforums.net/Threads/885327/Enable-Disable-date-in-jQuery-UI-DatePicker-based-on-Database-date-using-jQuery-AJAX-in-ASPNet/http://www.aspforums.net/Threads/885327/Enable-Disable-date-in-jQuery-UI-DatePicker-based-on-Database-date-using-jQuery-AJAX-in-ASPNet/Thu, 10 Nov 2016 23:35:28 GMTEnable / Disable date in jQuery UI DatePicker based on Database date using jQuery AJAX in ASP.Net<p>Hi amitj,</p> <p>I have created a sample which full fill your requirement</p> <p><span style="text-decoration: underline;">HTML</span></p> <pre class="brush: html">&lt;div&gt; &lt;asp:TextBox ID=&#34;txtDisableDates&#34; runat=&#34;server&#34; /&gt; &lt;/div&gt; &lt;div&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js&#34;&gt;&lt;/script&gt; &lt;script src=&#34;http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js&#34; type=&#34;text/javascript&#34;&gt;&lt;/script&gt; &lt;link href=&#34;http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/themes/redmond/jquery-ui.css&#34; rel=&#34;Stylesheet&#34; type=&#34;text/css&#34; /&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { var reserveddates = &#39;[&#39;; $.ajax({ type: &#34;POST&#34;, url: &#34;Default.aspx/GetDates&#34;, data: &#39;{}&#39;, contentType: &#34;application/json; charset=utf-8&#34;, dataType: &#34;json&#34;, success: function (response) { var xml = $.parseXML(response.d); var dates = $(xml).find(&#39;BookedDate&#39;); $.each(dates, function () { reserveddates += &#39;&#34;&#39; + $(this)[0].textContent.split(&#39;T&#39;)[0] + &#39;&#34;,&#39;; }); reserveddates += &#39;]&#39;; $(&#39;#txtDisableDates&#39;).datepicker({ beforeShowDay: function (date) { var string = jQuery.datepicker.formatDate(&#39;yy-mm-dd&#39;, date); return [reserveddates.indexOf(string) != -1] } }); } }); }); &lt;/script&gt; &lt;/div&gt;</pre> <p><span style="text-decoration: underline;">C#</span></p> <pre class="brush: csharp">[WebMethod] public static string GetDates() { DataTable dt = new DataTable(&#34;Date&#34;); dt.Columns.AddRange(new DataColumn[1] { new DataColumn(&#34;BookedDate&#34;, typeof(DateTime)) }); dt.Rows.Add(DateTime.Now.Date); dt.Rows.Add(DateTime.Now.Date.AddDays(5)); dt.Rows.Add(DateTime.Now.Date.AddDays(-5)); dt.Rows.Add(DateTime.Now.Date.AddDays(-2)); dt.Rows.Add(DateTime.Now.Date.AddDays(10)); dt.Rows.Add(DateTime.Now.Date.AddDays(20)); //You need to Bind Dates to DataTable and then bind datatable to DataSet and return like below. DataSet ds = new DataSet(&#34;Dates&#34;); ds.Tables.Add(dt); return ds.GetXml(); }</pre> <p><span style="text-decoration: underline;">ScreenShot</span></p> <p><img src="http://i988.photobucket.com/albums/af3/mudassarkhan/885327.gif" alt="" width="340" height="278" /></p> <p>&nbsp;</p>http://www.aspforums.net/Threads/885327/Enable-Disable-date-in-jQuery-UI-DatePicker-based-on-Database-date-using-jQuery-AJAX-in-ASPNet/http://www.aspforums.net/Threads/885327/Enable-Disable-date-in-jQuery-UI-DatePicker-based-on-Database-date-using-jQuery-AJAX-in-ASPNet/Fri, 11 Nov 2016 03:59:00 GMT