ASP.NET Calendar SelectedDates 屬性
ASP.NET Calendar SelectedDates 屬性

定義和用法
SelectedDates 屬性用于設(shè)置或返回日歷中被選的日期。
實(shí)例
下面的實(shí)例在某日期被選擇時(shí)輸出被選日期:
<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>
演示實(shí)例 ?

相關(guān)文章
- ASP.NET Web Pages 對(duì)象
- ASP.NET Razor 語(yǔ)法
- ASP.NET 數(shù)據(jù)庫(kù)連接
- ASP.NET HTML 服務(wù)器控件
- 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 控件 用 重復(fù)
- ASP.NET HTML 控件 RegularExpressionValidator
- ASP.NET HTML 控件 RequiredFieldValidator
- ASP.NET HTML 控件 XML RadiobuttonList
- C# 實(shí)例 Array 數(shù)組
- C# 實(shí)例 Switch 條件
- htmlbutton