Step1: Add Ajax Toolkit
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></asp:ToolkitScriptManager>
Step2: Add Calendar Extender along with Control ID
<asp:CalendarExtender ID="CalendarExtender" runat="server" TargetControlID="txtDateTime"></asp:CalendarExtender>
<asp:TextBox ID="txtDateTime" runat="server" AutoPostBack="True"></asp:TextBox>
Step3: Disable Future Dates
protected void Page_Load(object sender, EventArgs e)
{
CalendarExtender.EndDate = DateTime.Now.AddDays(-1);
}
No comments:
Post a Comment