ASP.NET CalendarDay IsWeekendProperty


CalendarDay 控件CalendarDay Control

Definition and Usage

The IsWeekend property is used to get whether the date is a Saturday or Sunday.

If the date is on a weekend, the property returns "TRUE", otherwise it returns "FALSE".


Example

The following example shows whether the selected date is on a weekend:

<script runat="server">
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
  If e.Day.IsSelected Then
    If e.Day.IsWeekend = "TRUE" Then
      Label1.Text = "YES"
    Else
      Label1.Text = "NO"
    End If
  End If
End Sub
</script>

<form runat="server">
  <asp:Calendar id="cal1" runat="server"
  OnDayRender="DaySelect"/>
  The selected date is in a weekend:
  <asp:Label id="Label1" runat="server"/>
</form>

Show example »

CalendarDay 控件CalendarDay Control Other Extensions