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.Highlight Dates in Bootstrap Calendar based on database Dates using jQuery Ajax in ASP.Net<p>Hi&nbsp;nauna,</p> <p>Check this example. Now please take its reference and correct your code.</p> <p><strong><span style="text-decoration: underline;">HTML</span></strong></p> <pre class="brush: html">&lt;link href=&#34;//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css&#34; rel=&#34;stylesheet&#34; /&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;//code.jquery.com/jquery-1.11.1.min.js&#34;&gt;&lt;/script&gt; &lt;script type=&#34;text/javascript&#34; src=&#34;//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js&#34;&gt;&lt;/script&gt; &lt;script src=&#34;FullCalendar.js&#34; type=&#34;text/javascript&#34;&gt;&lt;/script&gt; &lt;link href=&#34;StyleSheet.css&#34; rel=&#34;stylesheet&#34; type=&#34;text/css&#34; /&gt; &lt;link rel=&#34;stylesheet&#34; href=&#34;https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i&#34; /&gt; &lt;script type=&#34;text/javascript&#34;&gt; $(function () { $.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 (r) { var datesList = []; for (var i = 0; i &lt; r.d.length; i++) { datesList.push(new Date(r.d[i])); } var calendar = $(&#39;#calendar&#39;).fullCalendar({ dayRender: function (daysOfWeek, cell) { for (var i = 0; i &lt; datesList.length; i++) { var reqDate = datesList[i]; if (reqDate.toDateString() == daysOfWeek.toDateString()) { $(cell).addClass(&#39;fc-state-highlight&#39;); } } } }); }, failure: function (r) { alert(r.d); }, error: function (response) { alert(r.d); } }); }); &lt;/script&gt; &lt;div id=&#39;calendar&#39; style=&#34;height: 400px; width: 400px;&#34;&gt; &lt;/div&gt;</pre> <p><strong><span style="text-decoration: underline;">Code</span></strong></p> <p><strong>C#</strong></p> <pre class="brush: csharp">[System.Web.Services.WebMethod] public static List&lt;string&gt; GetDates() { // Get this date array from database. string[] dateList = new string[] { &#34;16 July 2019&#34;, &#34;17 July 2019&#34;, &#34;20 July 2019&#34;, &#34;25 Jun 2019&#34;, &#34;10 Aug 2019&#34; }; List&lt;string&gt; dates = new List&lt;string&gt;(); for (int i = 0; i &lt; dateList.Length; i++) { dates.Add(Convert.ToDateTime(dateList[i]).ToString(&#34;yyyy/MM/dd&#34;)); } return dates; }</pre> <p><strong>VB.Net</strong></p> <pre class="brush: vb">&lt;Services.WebMethod()&gt; Public Shared Function GetDates() As List(Of String) &#39; Get this date array from database. Dim dateList As String() = New String() {&#34;16 July 2019&#34;, &#34;17 July 2019&#34;, &#34;20 July 2019&#34;, &#34;25 Jun 2019&#34;, &#34;10 Aug 2019&#34;} Dim dates As List(Of String) = New List(Of String)() For i As Integer = 0 To dateList.Length - 1 dates.Add(Convert.ToDateTime(dateList(i)).ToString(&#34;yyyy/MM/dd&#34;)) Next Return dates End Function</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/bcZrNL9.gif" alt="" width="352" height="348" /></span></strong></p>https://www.aspforums.net:443/Threads/190632/Highlight-Dates-in-Bootstrap-Calendar-based-on-database-Dates-using-jQuery-Ajax-in-ASPNet/https://www.aspforums.net:443/Threads/190632/Highlight-Dates-in-Bootstrap-Calendar-based-on-database-Dates-using-jQuery-Ajax-in-ASPNet/Wed, 17 Jul 2019 05:51:15 GMT