Propriété IsOtherMonth ASP.NET

Définition et utilisation

La propriété IsOtherMonth est utilisée pour obtenir si la date appartient au mois affiché par le calendrier.

Si la date appartient au mois affiché, il est "FAUX", sinon il est "VRAI".

Exemple

L'exemple suivant montre si la date sélectionnée appartient au mois courant :

<script runat="server">
Procédure DaySelect(obj As Object, e As DayRenderEventArgs)
  Si e.Day.IsSelected Alors
    Si e.Day.IsOtherMonth Si = "TRUE" Alors
      Label1.Text = "NON"
    Sinon
      Label1.Text = "OUI"
    End If
  End If
End Sub
</script>
<form runat="server">
  <asp:Calendar id="cal1" runat="server"
  OnDayRender="DaySelect"/>
  La date sélectionnée est dans le mois courant :
  <asp:Label id="Label1" runat="server"/>
</form>

Exemple

Utilisez IsOtherMonth pour afficher si la date sélectionnée appartient au mois courant