ASP.NET CalendarDay DayNumberText 属性
最后更新于:2022-03-26 23:23:33
ASP.NET CalendarDay DayNumberText 属性
定义和用法
DayNumberText 属性用于获取表示日期的日期编号的一个字符串。
实例
下面的实例显示了如何从日历中选定的日期获取 DayNumberText:
<script runat=”server”>
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
If e.Day.IsSelected Then
Label1.Text = e.Day.DayNumberText
End If
End Sub
</script>
Sub DaySelect(obj As Object, e As DayRenderEventArgs)
If e.Day.IsSelected Then
Label1.Text = e.Day.DayNumberText
End If
End Sub
</script>
<form runat=”server”>
<asp:Calendar id=”cal1″ runat=”server”
OnDayRender=”DaySelect” />
The selected date is:
<asp:Label id=”Label1″ runat=”server”/>
</form>