ASP.NET IsSelected Property
Complete CalendarDay Control Reference
Definition and Usage
The IsSelected property is used to get whether or not a date is selected in a
calendar control.
This property returns "TRUE" if the date is selected.
Example
The following example shows if the selected day is in the current month or not:
<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 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>
Show example »
Complete CalendarDay Control Reference
Color Picker