I'm using the Ajax Control Toolkit Calendar Extender to add a default selected date to a calendar when the page loads, but the user can change it to any date they want. The problem I'm having is
if they change the date, their selection doesn't stick. Each time on postback the calendar resets back to showing todays date as the selected date instead of the date they selected. What am I doing wrong in my page_load?
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
txtReviewDate_CalendarExtender.SelectedDate = DateTime.Now.AddYears(2);
txtReceivedByHRDate_CalendarExtender.SelectedDate = DateTime.Now;
}
}
Go to the complete details ...