Disable past dates in Calendar control

Posted by Venkat | Labels:

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;
}
}

PayOffers.in