如何为TextBox设置TextChange事件?! [英] how to set TextChange Event For TextBox?!

查看:324
本文介绍了如何为TextBox设置TextChange事件?!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有

i有一个我想按一个键的文本框,一个服务器函数调用!!!



我添加OnTextChanged =TextBoxChang但它不能正常工作!!!

当TextBoxChang调用第一个Focuse然后然后模糊然后检查文本是否正在改变时!



i希望用户按A键服务器功能调用!!!

非常感谢





失败不是一个选项

< asp:TextBox ID =TextBoxCaptionClientIDMode =Staticrunat =serverOnTextChanged =TextBoxCaption_TextChanged> 





服务器端:

 protected void TextBoxCaption_TextChanged(object sender,EventArgs e) 
{
//当我按下每个键时不动作
}

解决方案





看看这里:

http://stackoverflow.com/questions/6400992/asp-net-textbox-textchanged-clarification-needed [ ^ ]


尝试设置AutoPostBack = true。


你必须使用jquery,以下是示例

< script type =text / javascript>

 

hi all
i Have A textBox that I Want When I Press a Key ،a Server Function Call!!!

I add OnTextChanged="TextBoxChang" but it Not Works Correctly!!!
when TextBoxChang call that first Focuse and Then Blur and Then Checked For Text is Changing Or not!

i want User Press A Key a Server Function Call!!!
thanks So Much


Failure Is Not An Option

<asp:TextBox ID="TextBoxCaption"  ClientIDMode="Static" runat="server" OnTextChanged="TextBoxCaption_TextChanged">



in server Side:

 protected void TextBoxCaption_TextChanged(object sender, EventArgs e)
    {
//Not Act When i Press Every Key
    }

解决方案

Hi,

Have a look here:
http://stackoverflow.com/questions/6400992/asp-net-textbox-textchanged-clarification-needed[^]


Try setting the AutoPostBack = true.


You have to use jquery for that, bellow is the example
<script type="text/javascript">


这篇关于如何为TextBox设置TextChange事件?!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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