0

Hi iam using a calendar control in my application,i need to select only the date from todays date and future date. am using this calendar control in the content place holder,can any one help me out with this problem.

Thanks in advance

catherin
  • 17
  • 6
  • Do you want to disable all dates in the past? http://geekswithblogs.net/dotNETvinz/archive/2009/05/03/how-to-disable-previous-dates-in-calendar-control.aspx – markpsmith Jun 17 '11 at 13:08
  • yes,but am using ajax calendar control, there is no such event in ajax control so what could i do now? – catherin Jun 20 '11 at 11:14
  • Try this: http://stackoverflow.com/questions/820192/disable-previous-dates-in-ajaxtoolkit-calendarextender – markpsmith Jun 20 '11 at 15:50

1 Answers1

2

Try this

protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    if (e.Day.Date < DateTime.Now.Date)
    {
        e.Day.IsSelectable = false;
    }
}
Vano Maisuradze
  • 5,829
  • 6
  • 45
  • 73