ASP.NET IsToday Property


CalendarDay Control Reference Complete CalendarDay Control Reference

Definition and Usage

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

This property returns "TRUE" if the date is the current date.


Example

The following example shows if the selected day is the current date or not:

<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>

Show example »

CalendarDay Control Reference Complete CalendarDay Control Reference

Color Picker

colorpicker