如何在aspx文本框中调用onblur客户端事件 [英] how to call onblur client event in aspx text box

查看:183
本文介绍了如何在aspx文本框中调用onblur客户端事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为仅适用于html控件的asp文本框添加onblur客户端事件.是否可以将这样的事件添加到asp控件文本框中,而不是将runatserver提供给html控件.
在此先感谢

i need to add onblur client event for an asp text box where it is only available for html controls. Is it possible to add such a event to an asp control text box instead of giving runatserver to an html control .
thanks in advance

推荐答案

<asp:TextBox ID="txtdob" runat="server" onblur="if(this.value!=''){somefunction(this.value)};" MaxLength="10" Width="75px"></asp:TextBox>


您可以在标记中添加任何属性.
You can add any attribute to the markup.


像这样使用...
use like this...
<asp:TextBox id="txtId" runat="sever"></asp:TextBox>


在页面后面的代码中

page_load {


in code behind page

page_load{

this.txtId.Attributes.add("onblur","javascript:funBlur();");


}


这篇关于如何在aspx文本框中调用onblur客户端事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆