- ASP.NET 教程
- ASP.NET简介
- ASP.NET Web Forms - 教程
- ASP.NET Web Forms - HTML 页面
- ASP.NET Web Forms - 服务器控件
- ASP.NET Web Forms - 事件
- ASP.NET Web Forms - HTML 表单
- ASP.NET Web Forms - 维持 ViewState
- ASP.NET Web Forms - TextBox 控件
- ASP.NET Web Forms - Button 控件
- ASP.NET Web Forms - 数据绑定
- ASP.NET Web Forms - ArrayList 对象
- ASP.NET Web Forms - Hashtable 对象
- ASP.NET Web Forms - SortedList 对象
- ASP.NET Web Forms - XML 文件
- ASP.NET Web Forms - Repeater 控件
- ASP.NET Web Forms - DataList 控件
- ASP.NET Web Forms - 数据库连接
- ASP.NET Web Forms - 母版页
- ASP.NET Web Forms - 导航
- ASP.NET Web Forms - HTML 服务器控件
- ASP.NET CalendarDay 控件
- ASP.NET Web Forms - Web 服务器控件
- ASP.NET Web Forms - Validation 服务器控件
- ASP.NET Web 控件标准属性
- ASP.NET 控件标准属性
ASP.NET Calendar SelectedDates 属性
Calendar 控件
定义和用法
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>
Calendar 控件
关注微信小程序
扫描二维码
程序员编程王