Latest web development tutorials

ASP.NET CalendarDay IsOtherMonth property

CalendarDay control CalendarDay control

Definition and Usage

IsOtherMonth property is used to obtain the date belongs month calendar is displayed.

If the day is the month shown, the property returns "FALSE", otherwise it returns "TRUE".


Examples

The following example shows whether the selected date current month:

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

The demonstration >>

CalendarDay control CalendarDay control