验证文本框 [英] verification of textbox

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

问题描述

在不单击按钮即可输入数据后如何验证文本框.
任何有代码的人都将其转发.

How to do verification of textbox just after entering data not on button click.
any one having code pls forward it.
thanks in advance.

推荐答案

在Updatepanel内部,在TextBox上使用TextChanged事件

void textBoxName_TextChanged(对象发送者,EventArgs e)
{
//您在此处编码
}

问候,
Karthik.J
Inside Updatepanel, use TextChanged event on the TextBox

void textBoxName_TextChanged(object sender, EventArgs e)
{
//you code here
}

-regards,
Karthik.J


您可以使用文本框''onblur''事件上的javascript来做到这一点.

尝试这样的事情:

You can do this using the javascript on ''onblur'' event of textbox.

Try something like this:

<asp:textbox id="your_id" runat="server" onblur="your script function" />


在TextBox上使用TextChanged事件

Use TextChanged event on TextBox

void textBox1_TextChanged(object sender, EventArgs e)
{
    //you code for verify
}


这篇关于验证文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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