ASP.NET Calendar SelectedDates 属性
定义和用法
SelectedDates 属性用于设置或返回日历中被选的日期。
下面的实例在某日期被选择时输出被选日期:
<script language="VB" runat="server">
Sub Change(obj As Object, e As EventArgs)
Dim i As Integer
For i = 0 To Cal1.SelectedDates.Count - 1
Response.Write(Cal1.SelectedDates(i).ToShortDateString())
Response.Write("<br />")
Next i
End Sub
</script>
<form runat="server">
<asp:Calendar id="cal1" runat="server"
SelectionMode="DayWeekMonth"
OnSelectionChanged="Change" />
</form>
Sub Change(obj As Object, e As EventArgs)
Dim i As Integer
For i = 0 To Cal1.SelectedDates.Count - 1
Response.Write(Cal1.SelectedDates(i).ToShortDateString())
Response.Write("<br />")
Next i
End Sub
</script>
<form runat="server">
<asp:Calendar id="cal1" runat="server"
SelectionMode="DayWeekMonth"
OnSelectionChanged="Change" />
</form>
演示实例 »
版权声明:本页面内容旨在传播知识,为用户自行发布,若有侵权等问题请及时与本网联系,我们将第一时间处理。E-mail:284563525@qq.com