ASP.NET CalendarDay IsToday 屬性
ASP.NET CalendarDay IsToday 屬性

定義和用法
IsToday 屬性用于獲取日期是否是當(dāng)前日期。
如果日期是當(dāng)前日期,則該屬性返回 "TRUE",否則返回 "FALSE"。
實(shí)例
下面的實(shí)例顯示了被選日期是否是當(dāng)前日期:
<script runat="server">
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
??If e.Day.IsSelected Then
????If e.Day.IsToday = "TRUE" Then
??????Label1.Text = "YES"
????Else
??????Label1.Text = "NO"
????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.IsToday = "TRUE" Then
??????Label1.Text = "YES"
????Else
??????Label1.Text = "NO"
????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>
演示實(shí)例 ?

相關(guān)文章
- ASP.NET Web Pages 文件夾
- ASP.NET Web Pages 圖表
- ASP.NET Razor VB 邏輯
- ASP.NET MVC Web 應(yīng)用程序
- ASP.NET MVC 視圖
- ASP.NET ViewState
- ASP.NET TextBox 控件
- ASP.NET Web 服務(wù)器控件
- ASP.NET CompareValidator 控件
- ASP.NET ListItem 控件
- ASP.NET Panel 控件
- ASP.NET TableCell 控件
- WebSecurity ChangePassword 方法
- HTML Table 2
- ASP.NET HTML 控件 CheckboxList
- C# 實(shí)例 For Each 循環(huán)
- VB 實(shí)例 基本的 HTML 表單
- VB 實(shí)例 For Each 循環(huán)
- VB 實(shí)例 If 條件
- ASP.NET Calendar Caption 屬性