W3Schools
home HOME Tutorials | References | Examples | Forum | About
Search W3Schools :

ASP.NET Tutorial
.NET HOME
.NET Intro
.NET vs ASP
.NET Install
.NET Pages
.NET Controls
.NET Events

ASP.NET Forms
.NET Forms
.NET ViewState
asp:TextBox
asp:Button

ASP.NET Binding
Data Binding
ArrayList
Hashtable
SortedList
XML Files
asp:Repeater
asp:DataList

ASP.NET Database
.NET DB Connection

ASP.NET 2.0
2.0 New Features
2.0 Master Pages
2.0 Navigation

References
HTML Controls
Web Controls
Validation Controls

Examples
ASP.NET Examples

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

W3Schools Tutorials
W3Schools Forum

Helping W3Schools

ASP.NET Calendar Control


Web Control Reference Complete Web Control Reference

Definition and Usage

The Calendar control is used to display a calendar in the browser.

This control displays a one-month calendar that allows the user to select dates and move to the next and previous months.


Properties

Property Description .NET
Caption The caption of the calendar 2.0
CaptionAlign The alignment of the caption text 2.0
CellPadding The space, in pixels, between the cell walls and contents 1.0
CellSpacing The space, in pixels, between cells 1.0
DayHeaderStyle The style for displaying the names of the days 1.0
DayNameFormat The format for displaying the names of the days 1.0
DayStyle The style for displaying days 1.0
FirstDayOfWeek What should be the first day of week 1.0
NextMonthText The text displayed for the next month link 1.0
NextPrevFormat The format of the next and previous month links 1.0
NextPrevStyle The style for displaying next and previous month links 1.0
OtherMonthDayStyle The style for displaying days that are not in the current month 1.0
PrevMonthText The text displayed for the previous month link 1.0
runat Specifies that the control is a server control.  Must be set to "server" 1.0
SelectedDate The selected date 1.0
SelectedDates The selected dates 1.0
SelectedDayStyle The style for selected days 1.0
SelectionMode How a user is allowed to select dates 1.0
SelectMonthText The text displayed for the month selection link 1.0
SelectorStyle The style for the month and weeks selection links 1.0
SelectWeekText The text displayed for the week selection link 1.0
ShowDayHeader A Boolean value that specifies whether the days of the week header should be shown 1.0
ShowGridLines A Boolean value that specifies whether the grid lines between days should be shown 1.0
ShowNextPrevMonth A Boolean value that specifies whether the next and previous month links should be shown 1.0
ShowTitle A Boolean value that specifies whether the title of the calendar should be shown 1.0
TitleFormat The format for the title of the calendar 1.0
TitleStyle The style of the title of the calendar 1.0
TodayDayStyle The style for today's date 1.0
TodaysDate Today's date 1.0
UseAccessibleHeader Specifying whether to use the <th> element for the day headers instead of the <td> element 2.0
VisibleDate The date that specifies the month that is currently visible in the calendar 1.0
WeekendDayStyle The style for weekends 1.0
OnDayRender The name of the function to be executed when when each day cell is created  
OnSelectionChanged The name of the function to be executed when the user selects a day, week, or month  
OnVisibleMonthChanged The name of the function to be 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 full description, go to Web Control Standard Attributes.

Control Standard Properties

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

For a full description, go to Control Standard Attributes.

Examples

Calendar
In this example we declare a Calendar control in its simplest use, in an .aspx file.

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

Calendar 3
In this example we declare a Calendar control in an .aspx file. The days are displayed with full names, the user may select a day, a week, or the whole month, and the selected day/week/month is displayed with a grey background color.


Web Control Reference Complete Web Control Reference


Ektron CMS400.NET Ektron - What do you want your website to do?
The Ektron Intranet
Take the video tour

The Ektron Intranet lets you do everything you need to do on your corporate intranet and everything you want to do... all with just one application.

What can you do with the Ektron Intranet?

Ektron

Navigate through content, documents, assets, colleagues and workgroups quickly and intuitively with enterprise search

Ektron

Communicate with friends and colleagues with forums, message boards and corporate blogging using the new Social Networking Platform

Ektron

Utilize the extensive out-of-the box features or customize your site through Ektron CMS400.NET's open architecture

Ektron

Promote collaboration in your organization through project workspaces where others can efficiently find information and work together

Ektron

Author/edit content, manage navigation, menus, audit trails, workflow and approvals with the best in breed Content Management

See why there are 20,000+ Ektron integrations worldwide.

Take the Video Tour TAKE THE VIDEO TOUR
Take the Video Tour or download a FREE TRIAL today.


Jump to: Top of Page or HOME or Printer Friendly Printer friendly page

W3Schools provides material for training only. We do not warrant the correctness of its contents. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.

Copyright 1999-2008 by Refsnes Data. All Rights Reserved.

Validate Validate W3C-WAI level A conformance icon W3Schools was converted to XHTML in December 1999