ASP.NET CalendarDay IsTodayPropiedad


CalendarDay 控件Control CalendarDay

Definición y uso

La propiedad IsToday se utiliza para obtener si la fecha es la fecha actual.

Si la fecha es la fecha actual, la propiedad devuelve "TRUE"; de lo contrario, devuelve "FALSE".


Ejemplo

El siguiente ejemplo muestra si la fecha seleccionada es la fecha actual:

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

Demostrar ejemplo »

CalendarDay 控件Control CalendarDay Otras extensiones