文本框已更改事件未在复合控件中触发.... [英] Textbox changed event is not firing in Composite control ....

查看:80
本文介绍了文本框已更改事件未在复合控件中触发....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时创建一个复合控件,其中....



i m creating a Composite control in which ....

public RadGrid Grid = new RadGrid();
 private RadTextBox txtbox = new RadTextBox();

 protected override void CreateChildControls()
        {
txtbox.TextChanged += new EventHandler(txtbox_TextChanged);

 Controls.Add(txtbox);
 Controls.Add(Grid);
 txtbox.AutoPostBack = true;
 txtbox.Attributes.Add("onkeyup","SendTextBox():"); 

}

 protected override void OnPreRender(EventArgs e)
        {
            ClientScriptManager cs = Page.ClientScript;
          
            cs.RegisterStartupScript(this.GetType(), "SendTextBox", "setTimeout('__doPostBack(\'" + txtbox.ID + "\',\'\')', 0);", true);
            base.OnPreRender(e);
        }

  protected void txtbox_TextChanged(object sender, EventArgs e)
        {
          // code for searching in grid 
            Grid.Rebind();
        }

当我写入txtbox时... txtbox_textChanged事件未被触发..请帮助

when i write in txtbox ...txtbox_textChanged event is not fired ..Please Help

推荐答案

请添加Autopostback =对于该Textbox是正确的,那么textchanged事件肯定会起作用。

u可以在该控件的属性中更改它。
Please Add Autopostback=true for that Textbox then the textchanged event will work for sure.
u can change it in the property of that control.


Check some of steps
1. If you have used any requiredfied validato or reqular expression (Client Validation)
Then mention in your textbox property CauseValidation="false"
2. Autopostback="true" in textbox property
Hope this will help you


这篇关于文本框已更改事件未在复合控件中触发....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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