Introduction to the Calendar Control

The Calendar control presents users with a calendar. It also offers date-picking functionality. A Calendar control must be placed within a Form or Panel control, or inside a control's template on a mobile Web page. You can also drag it onto a mobile user control page. The Calendar control displays a month of dates at a time. In addition, it shows the week preceding and the week following the month. Therefore, a total of six weeks appears at once.

ASP.NET Mobile Designer calendar

By default, the SelectedDate property is the date on the server. You can override this by manually setting the SelectedDate property. Use the VisibleDate property to specify what month appears on the calendar. The user can move from month to month, changing the visible date without affecting the current date.

By default, the first day of the week is specified by the ASP.NET property FirstDayOfWeek. However, your application can change that with the FirstDayOfWeek property. By default, the calendar shows a header with the days of the week. Use the ShowDayHeader property to remove the day header.

The SelectionMode property controls how dates are selected. The default setting, Day, enables the user to choose a single day. A setting of DayWeek enables the user to select a single day or a contiguous week. DayWeekMonth enables the user to select a day, a week, or a month.

The Calendar control raises a SelectionChanged event whenever the user changes the current date selection. By providing a handler for this event, your application can customize the calendar's behavior.

Applying device filters enables applications to set property override values for particular devices. In addition, applications can use data binding to set many of the property values for the Calendar control dynamically.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft