Latest web development tutorials

ASP.NET CalendarDay Date Properties

CalendarDay control CalendarDay control

Definition and Usage

Date variables represent date attribute is used to get the date.


Examples

The following example shows how to get a date from the calendar selected date:

<script runat="server">
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
If e.Day.IsSelected Then
Label1.Text = e.Day.Date
End If
End Sub
</script>

<form runat="server">
<asp:Calendar id="cal1" runat="server"
OnDayRender="DaySelect" />
The selected date is:
<asp:Label id="Label1" runat="server"/>
</form>

The demonstration >>

CalendarDay control CalendarDay control