在asp.net中单击清空TextBox中的内容
Protected void Page_load(object sender,EventArgs e)
{
TextBox1.Attributes.Add("OnClick", "this.value = '';");
}
本文介绍了一种在ASP.NET中通过添加JavaScript代码实现单击事件来清空TextBox控件内容的方法。具体做法是在Page_Load事件中使用TextBox的Attributes属性添加OnClick事件处理程序,将TextBox的值设置为空。
在asp.net中单击清空TextBox中的内容
Protected void Page_load(object sender,EventArgs e)
{
TextBox1.Attributes.Add("OnClick", "this.value = '';");
}

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