ASP.NET Calendar SelectedDate 属性
Calendar 控件
定义和用法
SelectedDate 属性用于设置或返回日历中被选的日期。
实例代码
下面的实例在某日期被选择时输出这个被选的日期:
<script language="VB" runat="server">
Sub Change(obj As Object, e As EventArgs)
Response.Write("Date: ")
Response.Write(cal1.SelectedDate.ToShortDateString())
End Sub
</script>
<form runat="server">
<asp:Calendar id="cal1" runat="server"
OnSelectionChanged="Change" />
</form>
Sub Change(obj As Object, e As EventArgs)
Response.Write("Date: ")
Response.Write(cal1.SelectedDate.ToShortDateString())
End Sub
</script>
<form runat="server">
<asp:Calendar id="cal1" runat="server"
OnSelectionChanged="Change" />
</form>
演示实例 »
Calendar 控件