Pages

Subscribe:

Ads 468x60px

Saturday, March 10, 2012

how to make disable weekend days or days in year less than 2011 in asp.net using c#

In this web programming tutorial we will learn that how to make weekend days or days in year less than 2011 disabled. The following code makes it impossible to select any weekend days or days in years greater than 2011:
protected void MyCalendar_DayRender(Object source, DayRenderEventArgs e)
{
// Restrict dates after the year 2010 and those on the weekend.
if (e.Day.IsWeekend || e.Day.Date.Year > 2010)
{
e.Day.IsSelectable = false;
}
}
The e.Day object is an instance of the CalendarDay class, which provides various properties.

No comments:

Post a Comment