FineUI 官方论坛
标题:
Calendar控件动态设置MinDate和MaxDate无效
[打印本页]
作者:
~~疯狂~~
时间:
2012-6-21 10:03
标题:
Calendar控件动态设置MinDate和MaxDate无效
下面是官方示例,在按钮中设置MaxDate无效。
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Calendar1.MinDate = DateTime.Now;
Calendar1.MaxDate = DateTime.Now.AddDays(10);
Button1.Text = String.Format("选中{0}", DateTime.Now.AddDays(2).ToString(Calendar1.DateFormatString));
}
}
protected void Calendar1_DateSelect(object sender, EventArgs e)
{
labResult1.Text = String.Format("选择的日期:{0}", Calendar1.SelectedDate.Value.ToString(Calendar1.DateFormatString));
}
protected void Button1_Click(object sender, EventArgs e)
{
//Calendar1.SelectedDate = DateTime.Now.AddDays(2);
Calendar1.MaxDate = DateTime.Now.AddDays(2);
}
复制代码
欢迎光临 FineUI 官方论坛 (https://fineui.com/BBS/)
Powered by Discuz! X3.4