ASP.NET CalendarDay IsOtherMonthPropriété


CalendarDay 控件Contrôle CalendarDay

Définition et utilisation

La propriété IsOtherMonth permet de déterminer si la date appartient au mois affiché par le calendrier.

Si la date appartient au mois affiché, cette propriété renvoie "FALSE", sinon elle renvoie "TRUE".


Exemple

L'exemple suivant indique si la date sélectionnée appartient au mois en cours :

<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"/>
  La date sélectionnée se trouve dans le mois en cours :
  <asp:Label id="Label1" runat="server"/>
</form>

Exemple de démonstration »

CalendarDay 控件Contrôle CalendarDay Autres extensions