ASP.NET CalendarDay IsOtherMonthPropiedad
Control CalendarDay
Definición y uso
La propiedad IsOtherMonth se utiliza para determinar si la fecha pertenece al mes que muestra el calendario.
Si la fecha pertenece al mes mostrado, la propiedad devuelve "FALSE"; de lo contrario, devuelve "TRUE".
Ejemplo
El siguiente ejemplo muestra si la fecha seleccionada pertenece al mes actual:
<script runat="server">
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
If e.Day.IsSelected Then
If e.Day.IsOtherMonth = "TRUE" Then
Label1.Text = "NO"
Else
Label1.Text = "YES"
End If
End If
End Subv </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>
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
If e.Day.IsSelected Then
If e.Day.IsOtherMonth = "TRUE" Then
Label1.Text = "NO"
Else
Label1.Text = "YES"
End If
End If
End Subv </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>
Ejemplo de demostración »
Control CalendarDay Otras extensiones