How to make a specific date in calender control unclicked in asp.net,c#

Posted by Shwetabansal888 under ASP.NET on 7/15/2010 | Views : 1098 | Status : [Member] | Replies : 1
Hi All,
Can anybody send me the code of --How to make a specific date in calender control unclicked in asp.net,c#?
Plz reply soon its very urgent.
Thanks,
Shweta




Responses

Posted by: Neeks on: 7/15/2010 [Member] Bronze

Up
0
Down
Can you please describe the problem little bit more.
So, I can let you know.

So, what you want,
You want to disable particular date?

You can do in DayRender method.

protected void Calendar1_DayRender(object sender, System.Web.UI.WebControls.DayRenderEventArgs e)
{
// Select all dates in the past
if (e.Day.Date < System.DateTime.Today)
{
// Disable date
e.Day.IsSelectable = false;
// Change color of disabled date
e.Cell.ForeColor = Color.Gray;
}


Shwetabansal888, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response