ASP.NET Calendar SelectedDates 属性
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>
演示实例 »
相关文章
- ASP.NET Web Pages 对象
- ASP.NET Razor 语法
- ASP.NET 数据库连接
- ASP.NET HTML 服务器控件
- ASP.NET HyperLink 控件
- ASP.NET ListItem 控件
- WebSecurity HasUserId 属性
- WebSecurity RequireUser 方法
- WebSecurity UserExists 方法
- HTML InputImage
- ASP.NET HTML 控件 Calendar
- ASP.NET HTML 控件 Calendar 3
- ASP.NET HTML 控件 Literal
- ASP.NET HTML 控件 用 重复
- ASP.NET HTML 控件 RegularExpressionValidator
- ASP.NET HTML 控件 RequiredFieldValidator
- ASP.NET HTML 控件 XML RadiobuttonList
- C# 实例 Array 数组
- C# 实例 Switch 条件
- htmlbutton