.NET 2.0 中textbox的Readonly属性为真时如何取值

1、使用Request.Form["TextBox1"].Trim();来获取!

2、先将TextBox的ReadOnly=false,然后再加上

protected void Page_Load(object sender, EventArgs e)
{
    if(!Page.IsPostBack){
      TextBox1.Attributes["readonly"]="true";
    }
}

你可能感兴趣的:(readOnly)