Disable past dates in Calendar control
Here we are going to see how to disable the past date in the Calendar contorl
<asp:Calendar ID="Calendar1" runat="server" OnDayRender="Calendar_DayRender"></asp:Calendar>
protected void Calender_DayRender(object sender, DayRenderEventArgs e)
{
if (e.Day.Date < DateTime.Today.Date)
{
e.Day.IsSelectable = false;
}
}
0 comments:
Post a Comment
Thanks for the Comments.