Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to disable past/previous dates in Calendar Control in ASP.Net?
Posted
Comments
Thanks7872 1-Jul-14 6:30am    
Copy the question and paste it in your favorite search engine,you will get answer your self.
teja u 2-Jul-14 1:29am    
i cant find Claender1_DyRender() event ?

1 solution

You have to implement some logic in DayRender event of calendar control so that it disables the past dates. Try the code as follows:
C#
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
    if (e.Day.Date.CompareTo(DateTime.Today) < 0)
    {
        e.Day.IsSelectable = false;
    }
}

Sometimes searching a solution is easier & faster than asking questions. :)

- DD
 
Share this answer
 

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