ASP.NET CalendarDay DateProperty


CalendarDay 控件CalendarDay Control

Definition and Usage

The Date property is used to get a date variable that represents the date.


Example

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

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

Try it Yourself »

CalendarDay 控件CalendarDay Control Other Extensions