Click here to Skip to main content
15,896,063 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to validate the selected date should be greater than the current date using regular expression or some other method( Javascript etc)
Posted

1 solution

If you are using calendar control you can do this as :
C#
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
  {
      if (e.Day.Date <= DateTime.Today.Date)
      {
          e.Cell.Enabled= false; // Changes the Cells Enable Property
          e.Day.IsSelectable = false; // Disables the Cells Click Property
      }
  }

for more refer :http://www.dotnetfunda.com/articles/article600-customising-the-calendar-control-in-aspnet.aspx[^]


or while using a Ajax Calendar Extender control you can do as something explained here :
https://forums.asp.net/t/1615792.aspx?CalendarExtender+date+checker[^]
 
Share this answer
 
v2
Comments
VJ Reddy 26-Apr-12 4:21am    
Good answer. 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900