asp.net.ph

CalendarDay Class

System.Web.UI.WebControls Namespace   Calendar Class


Represents a day on the Calendar control.

CalendarDay Class Members

Collapse   Constructors

Visibility Constructor Parameters
public CalendarDay ( DateTime date , Boolean isWeekend , Boolean isToday , Boolean isSelected , Boolean isOtherMonth , String dayNumberText )

Collapse   Properties

Visibility Name Value Type Accessibility
public Date DateTime [ Get ]
public DayNumberText String [ Get ]
public IsOtherMonth Boolean [ Get ]
public IsSelectable Boolean [ Get , Set ]
public IsSelected Boolean [ Get ]
public IsToday Boolean [ Get ]
public IsWeekend Boolean [ Get ]

Remarks

For a list of initial property values for an instance of CalendarDay, see the CalendarDay constructor.

Example

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 

See Also

Calendar Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph