ASP.NET Tutoria...login
ASP.NET Tutorial
author:php.cn  update time:2022-04-11 14:18:18

Calendar control


ASP.NET Calendar Control


up.gif Web server control

Definition and usage

Calendar control to display the calendar in the browser.

This control can display a calendar for a certain month, allowing the user to select a date, or jump to the previous or next month.


Properties

PropertiesDescription.NET
CaptionThe title of the calendar. 2.0
CaptionAlignAlignment of the calendar title text. 2.0
CellPaddingThe space, in pixels, between the cell border and the content. 1.0
CellSpacingThe spacing between cells, in pixels. 1.0
DayHeaderStyleThe style that displays the names of the days of the week. 1.0
DayNameFormatThe format that displays the names of the days of the week. 1.0
DayStyleThe style of displaying the date. 1.0
FirstDayOfWeekWhich day is the first day of the week. 1.0
NextMonthText Displays the text of the next month link. 1.0
NextPrevFormatFormat of next month and previous month links. 1.0
NextPrevStyle Displays the style of the next month and previous month links. 1.0
OtherMonthDayStyleThe style that displays dates that are not in the current month. 1.0
PrevMonthTextDisplays the text of the previous month link. 1.0
runat Specifies that the control is a server control. Must be set to "server". 1.0
SelectedDateThe selected date. 1.0
SelectedDatesSelected dates. 1.0
SelectedDayStyleThe style of the selected date. 1.0
SelectionModeAllows how the user selects dates. 1.0
SelectMonthTextThe text displayed for the month selection link. 1.0
SelectorStyleThe style of the month and week selection link. 1.0
SelectWeekTextThe text that displays the select link for the week. 1.0
ShowDayHeaderBoolean value indicating whether to display headers for each day of the week. 1.0
ShowGridLinesBoolean value, specifies whether to display grid lines between dates. 1.0
ShowNextPrevMonthBoolean value, specifies whether to display the next month and previous month links. 1.0
ShowTitleBoolean value, specifies whether to display the title of the date. 1.0
TitleFormatThe format of the date title. 1.0
TitleStyleThe style of the date title. 1.0
TodayDayStyleThe style of today’s date. 1.0
TodaysDateGets or sets the value of today’s date. 1.0
UseAccessibleHeaderSpecifies whether to use <th> instead of <td> elements for day headers.2.0
VisibleDateGets or sets the day of the month specified to be displayed on the Calendar control. 1.0
WeekendDayStyleWeekend style. 1.0
OnDayRenderThe name of the function that is executed when each day's cell is created.
OnSelectionChangedThe name of the function executed when the user selects a day, week, or month.
OnVisibleMonthChangedThe name of the function that is executed when the user navigates to a different month.

Web control standard properties

AccessKey, Attributes, BackColor, BorderColor, BorderStyle, BorderWidth, CssClass , Enabled, Font, EnableTheming, ForeColor, Height, IsEnabled, SkinID, Style, TabIndex, ToolTip, Width

For a complete description, visit Web Control Standard Properties.

Control standard properties

AppRelativeTemplateSourceDirectory, BindingContainer, ClientID, Controls, EnableTheming, EnableViewState, ID, NamingContainer, Page, Parent, Site, TemplateControl, TemplateSourceDirectory, UniqueID, Visible

For a complete description, please visit Control Standard Properties.


tryitimg.gifTry it - Example

Calendar
In this example, we declare the simplest one in the .aspx file Calendar control.

Calendar 2
In this example, we declare a Calendar control in the .aspx file. The date is shown with the full name in blue, weekends are shown with red text on a yellow background, and the current date is shown with a green background.

Calendar 3
In this example, we declare a Calendar control in the .aspx file. The date is displayed with its full name, and the user can select a day, week, or entire month. The selected day/week/month is displayed with a gray background color.


up.gif Web Server Control

php.cn