.net textbox 失去焦点问题

来源:百度知道 编辑:UC知道 时间:2024/06/18 04:15:54
主要想在textbox失去焦点时引发事件。在网上找了很久了,也有,就好像
http://hi.baidu.com/mycoolcolor/blog/item/74b3e2352fb7008ea61e1284.html里说的,但是有一个问题,我建了类后,应该怎样用呢?

是在服务器事件里直接敲:
protected void TxtUserId_Onblur(object sender, EventArgs e)
{
}
吗???

textBox1.Attributes.Add("onblur","changeName();");

然后在aspx文件内写个
<script>
function changeName()
{
alert("changename!");
}
</script>

应该和button click事件一样,在前台textbox 的代码 里加上onblur="TxtUserId_Onblur"