The Calendar class displays a single month calendar that allows the user to select dates and move to the next or previous month. It is part of the System.Web.UI.WebControls namespace.
There are several style properties (color, border, cell, etc) that can be set to change the look and feel of the control. Below are the most useful (non-style) properties.
DayNameFormat
Gets or sets the name format of days of the week.
FirstDayOfWeek
Gets or sets the day of the week to display in the first day column of the Calendar control.
SelectedDate
Gets or sets the selected date.
SelectedDates
Gets a collection of System.DateTime objects that represent the selected dates on the Calendar control.
SelectionMode
Gets or sets the date selection mode on the Calendar control that specifies whether the user can select a single day, a week, or an entire month.
TodaysDate
Gets or sets the value for today’s date.
VisibleDate
Gets or sets the date that specifies the month to display on the Calendar control.
Simple Example of the Calendar Control
ASP.NET SOURCE
<asp:Calendar
ID="Calendar1" runat="server"
BackColor="#FFFFCC" BorderColor="#FFCC66"
BorderWidth="1px"
DayNameFormat="Shortest"
Font-Names="Verdana" Font-Size="8pt"
ForeColor="#663399" Height="200px"
ShowGridLines="True" Width="220px"
OnSelectionChanged="Calendar1_SelectionChanged">
<SelectedDayStyle BackColor="#CCCCFF" Font-Bold="True" />
<TodayDayStyle BackColor="#FFCC66" ForeColor="White" />
<SelectorStyle BackColor="#FFCC66" />
<OtherMonthDayStyle ForeColor="#CC9966" />
<NextPrevStyle Font-Size="9pt" ForeColor="#FFFFCC" />
<DayHeaderStyle BackColor="#FFCC66"
Font-Bold="True" Height="1px" />
<TitleStyle BackColor="#990000"
Font-Bold="True" Font-Size="9pt"
ForeColor="#FFFFCC" />
</asp:Calendar>
C# SOURCE
using System.Web;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = Calendar1.TodaysDate.ToString();
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
Label1.Text = Calendar1.SelectedDate.ToString();
}
}
RESULT

The Calendar control is a rich control that can be extended much further. Online appointment calendars and event calendars are just the beginning.