使用AJAX日历控件,显示某些日期(CalendarExtender)

1. The HTML Markup

 <div>
        <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></ajaxToolkit:ToolkitScriptManager>
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TextBox1" Format="yyyy/MM/dd"></ajaxToolkit:CalendarExtender>
    </div>

 2. The Page_Load event

//disable the past date
            CalendarExtender1.StartDate = DateTime.Now;

            //disable the futhre date 
            CalendarExtender1.EndDate = DateTime.Now;

            //Start Calendar after one month from the Present Date
            CalendarExtender1.StartDate = DateTime.Now.AddMonths(1);

 More information please refer to the link below.

http://jsbin.com/rolifo/4/edit?html,output

http://www.c-sharpcorner.com/UploadFile/0c1bb2/disable-future-and-past-date-of-ajax-calendar-in-Asp-Net-C-Sharp/

 

posted @ 2015-02-03 18:50  songxia777  阅读(1310)  评论(0编辑  收藏  举报