ASP.NET CalendarDay Date 属性
定义和用法
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>
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>
演示实例 »
版权声明:本页面内容旨在传播知识,为用户自行发布,若有侵权等问题请及时与本网联系,我们将第一时间处理。E-mail:284563525@qq.com