当我们在使用CalendarExtender控件时,TextBox的ReadOnly属性默认为'true",要获取TextBox中的值,我们可以在动态加载页面时再设置TextBox的只读属性为"True"
if (!IsPostBack)
{
this.txtItemStartTime.Attributes.Add("readonly", "true");
}
本文介绍如何在使用CalendarExtender控件时设置TextBox的ReadOnly属性,默认情况下此属性被设置为'true'以防止用户直接编辑日期。通过在页面加载时判断是否为回发(postback),我们可以动态地调整TextBox的只读状态。
1216

被折叠的 条评论
为什么被折叠?



