Sunday, 7 August 2011

How to make Asp.net Calendar control Read-Only

C# Code behind

protected void calendarMonth_DayRender(object sender, DayRenderEventArgs e)
{
 // Making calendar day Read-Only, i.e no post back
        e.Cell.Text = e.Day.DayNumberText;
}
- you can disable next and prev month directly from property at design time
- the above code will remove the links of day with simple plain text

0 comments:

Post a Comment