hi, Gary
Yes, this is the one that you need.
It is very easy to use it. Here is a little example:
Put a datepicker/calendar in your page, and put a button in your page as well.
Code: C#
public static DateTime dtToday = new DateTime(2007, 7, 6);
protected void Page_Load(object sender, EventArgs e)
{
this.DatePicker1.DisabledDates.Add(dtToday);
}
protected void Button1_Click(object sender, EventArgs e)
{
this.DatePicker1.DisabledDates.Remove(dtToday);
}
When the page gets load, you can see the date 07/06 is disabled. But after you click Button1, it becomes enabled. The only thing you need be careful is, even in most case, it only uses Date part of DateTime in UI, but when you call Add or Remove, comes to compare, it compares the whole DateTime object, including date and time. Both has to be the same, otherwise, it wil show IndexOutofRange or some similar error.
Thanks.