ASP.NET CalendarDay IsSelected 属性
ASP.NET CalendarDay IsSelected 属性
CalendarDay 控件定义和用法
IsSelected 属性用于获取日期在 Calendar 控件中是否被选定。
如果日期在 Calendar 控件中被选定,则该属性返回 "TRUE",否则返回 "FALSE"。
实例
下面的实例显示了被选定的日期是否在当前的月份中:
<script runat="server">
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
If e.Day.IsSelected Then
If e.Day.IsOtherMonth = "TRUE" Then
Label1.Text = "NO"
Else
Label1.Text = "YES"
End If
End If
End Sub
</script>
<form runat="server">
<asp:Calendar id="cal1" runat="server"
OnDayRender="DaySelect"/>
The selected date is in the current month:
<asp:Label id="Label1" runat="server"/>
</form>
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
If e.Day.IsSelected Then
If e.Day.IsOtherMonth = "TRUE" Then
Label1.Text = "NO"
Else
Label1.Text = "YES"
End If
End If
End Sub
</script>
<form runat="server">
<asp:Calendar id="cal1" runat="server"
OnDayRender="DaySelect"/>
The selected date is in the current month:
<asp:Label id="Label1" runat="server"/>
</form>
演示实例 »
相关文章
- ASP.NET Web Pages HTML 表单
- ASP.NET Web Pages 帮助器
- ASP.NET Razor C# 变量
- ASP.NET MVC 安全
- ASP.NET 事件句柄
- ASP.NET Hashtable
- ASP.NET SortedList
- ASP.NET LinkButton 控件
- ASP.NET RadioButtonList 控件
- ASP.NET TableRow 控件
- WebSecurity ChangePassword 方法
- WebSecurity Login 方法
- WebSecurity RequireRoles 方法
- ASP.NET HTML 控件 DropdownList
- ASP.NET HTML 控件 Radiobutton
- ASP.NET HTML 控件 Table
- ASP.NET HTML 控件 xml
- ASP.NET HTML 控件 CustomValidator
- C# 实例 If Else 条件
- ASP.NET Calendar SelectedDate 属性