System.Web.UI.WebControls Namespace Calendar Class
Represents a day on the Calendar control.
For a list of initial property values for an instance of CalendarDay, see the CalendarDay constructor.
The following example demonstrates how to check the properties of a CalendarDay to determine if the days on the Calendar are within the month currently displayed and not on the weekend. These days are displayed in khaki.
<html>
<head>
<script language = "C#" runat = "server">
void DayRender ( Object src, DayRenderEventArgs e ) {
if ( !e.Day.IsOtherMonth && !e.Day.IsWeekend )
e.Cell.BackColor=System.Drawing.Color.Khaki;
}
</script>
</head>
<body>
<h3>Calendar onDayRender Event Example</h3>
<form runat = "server">
<asp:Calendar runat = "server"
WeekendDayStyle-BackColor = "SteelBlue"
onDayRender = "DayRender" />
</form>
</body>
</html>
Show me
Calendar