• AJAX Control Toolkit Calendar(弹出式日历)


    虽然不使用Ajax Contorl Toolkit也能实现该效果,当然如果使用ASP.NET中自带的Calendar要解决异步刷新还要配合UpdatePanel使用。但或许该控件对多数人还是相对容易些。首先对该控件的一些常用属性做一下基本的了解:

    TagetControlID - 一般是TextBox的 ID.

    CSSClass - Name of the Cascading Style Sheet class Use to style the calendar.

    DaysModeTitleFormat - Format string used to display Days Mode Title.The default value is "MMMM,yyyy".(ex:August,2011)

    DefaultView - Gets or sets the default view of the calender.The default value is Days.(可以设置为 Moths or Years)

    Format - Format string used to display the selected date.The default value is "d"(ex:8/11/2011).(and "yyyy年MM月dd日"(2011年8月8日),"yyyy-MM-dd"(2011-8-8))

    PopupButtonID - The ID of a control to show the calendar popup when clicked. If this value is not set, the calendar will pop up when the textbox receives focus. (可以用ImageButton或者image标签来作为PopupButton)         

    PopupPosition - Gets or sets the popup position of the calendar. The default value is BottomLeft.

    SelectedDate - Gets of Sets the data the calendar is initialized with.(初始化的日期)

    TodaysDateFormat - Format string used to display today's date.The default value is "MMMM d,yyyy"

    {说明:弹出式日历是在TargetControl聚焦(Focus)时,弹出,如果设置了PopupButtonID时,点击该控件时弹出日历}

     1   <asp:ScriptManager ID="ScriptManager1" runat="server" />
    2 <div>
    3 <br /><br />
    4 <b>Default Calendar:</b><br />
    5 <asp:TextBox ID="Date1" runat="server"></asp:TextBox>
    6 <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server"
    7 ClearTime="true"
    8 TargetControlID="Date1" SelectedDate="8/08/2011">
    9 </ajaxToolkit:CalendarExtender>
    10 <br /><br />
    11 <b>Calendar with Custom Style and Date Format:</b><br />
    12 <asp:TextBox ID="Date2" runat="server"></asp:TextBox>
    13 <ajaxToolkit:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="Date2" CssClass="MyCalendar" Format="yyyy年MM月dd日">
    14 </ajaxToolkit:CalendarExtender>
    15 <br /><br />
    16 <b>Calendar with associated button:</b><br />
    17 <asp:TextBox ID="Date3" runat="server"></asp:TextBox>
    18 <asp:Image ID="Image1" runat="server" ImageUrl="~/Calendar_scheduleHS.png" />
    19 <ajaxToolkit:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="Date3" PopupButtonID="Image1" DaysModeTitleFormat="yyyy年,MM月" Format="yyyy-MM-dd" DefaultView="Days">
    20 </ajaxToolkit:CalendarExtender>

      

  • 相关阅读:
    tomcat bug之部署应用的时候经常会发上startup failed due to previous errors
    maven编译项目理解
    MyReport报表引擎2.6.5.0新功能
    PHP入门-摘要表格处理问题
    EnumMap源代码阅读器
    MySQL几种方法的数据库备份
    工作日志2014-08-19
    Linux通过网卡驱动程序和版本号的信息
    JS于,子类调用父类的函数
    hdu 5007 水 弦
  • 原文地址:https://www.cnblogs.com/January/p/2130913.html
Copyright © 2020-2023  润新知