控件内有一button,添加的click事件并未触发,可是在页面load内写
Button btn = PaginationWithNumber1.FindControl("控件id") as Button;以后该button的事件就可以触发,请教高手这是什么原因啊

解决方案 »

  1.   

    findcontrol内的id是button的,没说清楚`````
      

  2.   

    如果你 用的 是2003 的话 InitializeComponent()里面的事件注册可能已经丢失 你去 看看 , 呵呵 猜测而已!!
      

  3.   

    俺用的是2008
    注册的是在CreateChildControls()内
      

  4.   

        public class WebCustomControl1 : WebControl
        {        
            protected override void Render(HtmlTextWriter writer)
            {
                base.Render(writer);
            }      
            protected override void CreateChildControls()
            {
                Button BtnJump = new Button();                       
                BtnJump.Click += new EventHandler(BtnJump_Click);                         
                BtnJump.Text = "确定";
                Controls.Add(BtnJump);
            }
            void BtnJump_Click(object sender, EventArgs e)
            {                    }      
        
        
        }
       
    这么尝试情况依旧.....郁闷
      

  5.   

    原来继承个接口就可解决....INamingContainer