我对“模糊"有疑问 [英] i have a problem with 'onblur'

查看:89
本文介绍了我对“模糊"有疑问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Plz ...谁能在代码中帮助我,如何在asp.net中的文本框上应用"onblur"(MS Visual Web Developer 2010 Express)
谢谢....

Plz...Can anyone help me in code,how to apply ''onblur'' on textbox in asp.net(MS visual web developer 2010 express)
Thank You....

推荐答案

您可以在设计文件中或文件后的代码中进行操作

设计:
< asp:TextBox runat ="server" onblur ="Javascript:alert(" 1234);" />


背后的代码:

You can do it in both design file or in code behind file

Design:
<asp:TextBox runat="server" onblur="Javascript:alert(''1234'');" />


Code Behind:

myTextBox.Attributes.Add("onblur","alert(''1234'');");


我在google上找到了它(google是免费的-您也可以使用它).

在您的aspx文件中:

I found this with google (google is free - you can use it too).

In your aspx file:

<asp:textbox onblur="javascript:msgBox(''test'');"/> // assume msgBox is your own javascript function



在您的aspx.cs文件中:



In your aspx.cs file:

protected void Page_Load(Object sender, System.EventArgs a)
{
    TextBox1.Attributes.Add("onblur", "javascript:msgbox('Test');");
}


这篇关于我对“模糊"有疑问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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