The calendar control, while useful has one undesirable behavior: it re-hides when changing the visible month. Fortunatly it's an easy fix using the calendar's VisibleMonthChanged event handler. If you have visual studio you can click on the calendar in design view, the click on the 'Events' (lightning bolt) icon and double click on 'VisibleMonthChanged' under 'Action' or add the following line to the InitializeComponent() method in CalendarPopup.ascx.cs :
this
.calendar.VisibleMonthChanged += new MonthChangedEventHandler(this.calendar_VisibleMonthChanged);
To make the calendar remain visible after the postback, we need to set it's display attribute to auto (a blank attribute will work as well):
private void calendar_VisibleMonthChanged(object sender, MonthChangedEventArgs e)
{
calendarDiv.Style.Add("display", "auto");
}
Now the calendar will remain visible after a postback!
Edit: I did discover one minor drawback with this technique. If the user opens the calendar, changes the visible month, then closes the calendar by clicking the button again, AND triggers a postback for some reason other than selecting the date, the calendar will appear again. It's a minor issue, but if I figure out an easy way around it, I'll post it.