前台:
<asp:TextBox ID="txt_userNames" runat="server" Width="638px"></asp:TextBox>
解决办法:
1)
protected void Page_Load(object sender, EventArgs e)
{
txt_userNames.Attributes["contentEditable"] = "false";
}
未验证的方法:
2.
其实如果是设置客户端属性的话,设置客户端的readonly属性应该也是可以的:
TextBox1.Attributes["readonly"] = "true";