Make previous calendar dates not selectable in ASP.NET
In order to make all dates before the current date, not able to be selected, in the onDayRender event for your Calendar:
if (e.Day.Date < DateTime.Today)
{
e.Day.IsSelectable = false;
}To make it more obvious to the end user, also add:
e.Cell.BackColor = Drawing.Color.GhostWhite; e.Cell.ForeColor = Drawing.Color.Gainsboro;


Leave a Reply