Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

disable specific dates in ajax calendar control based on database selection

$
0
0

I need to use ajax calendar control to show dates from current date and disable & highlight dates stored in database table.

I am able to disable previous dates and limit selection to one month from current date and Also highlight the dates which are already booked for event in asp.net calendar control but not in ajax calendar control.

plz suggets

<asp:TextBox runat="server" ID="txtMyTextBox">
</asp:TextBox>
<asp:ImageButton runat="Server" ID="ibtnDepartDate" ImageUrl="~/Images/Calendar.png"
OnClick="calImageButton_Click" AlternateText="Click Here"/>
<asp:Calendar runat="server" ID="calMyCalendar" Visible="False" OnDayRender="myDayRenderMethod" OnSelectionChanged="calMyCalendar_SelectionChanged" BackColor="White" BorderColor="#3366CC" BorderWidth="1px" CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt" ForeColor="#003399" Height="200px" Width="220px">

</asp:Calendar>

code:

Protected Sub myDayRenderMethod(sender As Object, e As DayRenderEventArgs)
Dim tdate As String = "15/04/2013"
If e.Day.[Date] = (System.DateTime.Now.AddDays(tdate)) Then
e.Day.IsSelectable = False
e.Cell.Font.Strikeout = True
End If

End Sub

But its not working


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>