我有一个文本框,当用户跳出文本框(onBlur事件)时,我需要验证其值(如果textbox的值为50,则显示消息在lblShowMsg中)。我似乎无法得到正确的语法。ASP.Net textbox onblur事件
我有这样的代码在我的页面加载事件:
protected void Page_Load(object sender, EventArgs e)
{
txtCategory.Attributes.Add("onblur", "validate()");
}
但我似乎无法得到javascript代码正确。有什么建议么?
你为什么要在动态添加属性onblur而不是标记? – awright18 2010-03-05 03:13:04