Controls You Can Use on Web Forms ASP.NET Standard Controls Calendar Control
You can specify that users can select individual days, individual weeks, or an entire month in the Calendar control. Alternatively, you can disable day selection altogether.
- Set the Calendar control’s SelectionMode property to one of the values defined in the SelectionMode enumeration: Day, DayWeek, or DayWeekMonth. To disable all date selection, set the property to None.
NOTE: Users can only select a single day, a single week, or the whole month. However, in code you can select any arbitrary set of dates. For details, see Selecting Dates Programmatically.
When selection is enabled, whenever the user selects a day, week, or month, the form is submitted and an event is raised for which you can create a method. For details, see Responding to Date Selection.
To allow the user to select a date, the calendar is displayed with links. Individual days contain a link with the date number. If you set the calendar to allow users to select a week or the whole month, an extra column with selection links is added to the left of the calender.
NOTE: You can also control date selection for individual days. For example, you might specify that users can click on specific days of the month, such as holidays. For details about customizing days in this way, see Customizing Individual Days.
You can specify the text for the week and month selection links.
- Set the SelectWeekText and SelectMonthText properties to the text you want to use as a navigation link.
You can also set the font, color, and border style of the column containing the week and month selection links and set styles for days. For details, see Formatting Calendar Elements Using Styles.