ASP.NET CalendarDay IsTodayProperty


CalendarDay 控件CalendarDay Control

Definition and Usage

The IsToday property is used to get whether the date is the current date.

If the date is the current date, the property returns "TRUE", otherwise it returns "FALSE".


Example

The following example shows whether the selected date is the current date:

<script runat="server">
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
  If e.Day.IsSelected Then
    If e.Day.IsToday = "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 the current month:
  <asp:Label id="Label1" runat="server"/>
</form>

Run Example »

CalendarDay 控件CalendarDay Control Other Extensions