这是我在我的aspx页面中使用的代码
<asp:TextBox ID="ReqFromTxtBox" runat="server" class="textBox" Width="155px" onKeyPress="javascript: return false;" onPaste="javascript: return false;">
</asp:TextBox>
<cc1:CalendarExtender ID="ReqFromTxtBox_CalendarExtender" runat="server" PopupButtonID="ReqFromCalendarBtn" TargetControlID="ReqFromTxtBox">
</cc1:CalendarExtender>
答案 0 :(得分:1)
使用EndDate
在页面加载事件集DateTime.Now
上将 nbling未来日期设置为今日日期:
protected void Page_Load(object sender, EventArgs e)
{
ReqFromTxtBox_CalendarExtender.EndDate = DateTime.Now; //to disable future Dates
}
和停用过去的日期,您必须将StartDate
设置为今天:
protected void Page_Load(object sender, EventArgs e)
{
ReqFromTxtBox_CalendarExtender.StartDate= DateTime.Now; //to disable past Dates
}
Reference Link How To Disable Past of Future Date of Calendar Extender