ASP.NET CalendarDay IsOtherMonth 属性

返回上一级

ASP.NET CalendarDay IsOtherMonth 属性用于获取日期是否属于日历所显示的月份

如果日期属于所显示的月份,则该属性返回 "FALSE",否则返回 "TRUE"

范例

下面的范例显示了被选日期是否属于当前月

<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 Subv
</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 基础教程

关于   |   FAQ   |   我们的愿景   |   广告投放   |  博客

  简单教程,简单编程 - IT 入门首选站

Copyright © 2013-2018 简单教程 twle.cn All Rights Reserved.