M
matt.delvecchio
hello,
ive got a usercontrol that has some textboxes, a button, and a handler
routine for its button_click. when this usercontrol is dropped into a
page via the designer, it functions as expected -- when the button is
clicked its event handler loads up the routine and i do db stuff.
however, i am now adding the control to the page programmatically (on a
page's button click), via:
Controls.PackageInfo info =
(Controls.PackageInfo)LoadControl("~/controls/packageInfo.ascx");
info.ID = "ucPackageInfo";
phInfoPanel.Controls.Add(info);
....and it shows up. but ive discovered that the control's button's
event handler no longer works -- setting a breakpoint on it shows that
its never called. the hanlder is mapped to it via:
private void InitializeComponent()
{
this.btnSubmit.Click += new
System.EventHandler(this.btnSubmit_Click);
}
....which the debugger hits.
any ideas why it no longer handles itself??
thanks!
matt
ive got a usercontrol that has some textboxes, a button, and a handler
routine for its button_click. when this usercontrol is dropped into a
page via the designer, it functions as expected -- when the button is
clicked its event handler loads up the routine and i do db stuff.
however, i am now adding the control to the page programmatically (on a
page's button click), via:
Controls.PackageInfo info =
(Controls.PackageInfo)LoadControl("~/controls/packageInfo.ascx");
info.ID = "ucPackageInfo";
phInfoPanel.Controls.Add(info);
....and it shows up. but ive discovered that the control's button's
event handler no longer works -- setting a breakpoint on it shows that
its never called. the hanlder is mapped to it via:
private void InitializeComponent()
{
this.btnSubmit.Click += new
System.EventHandler(this.btnSubmit_Click);
}
....which the debugger hits.
any ideas why it no longer handles itself??
thanks!
matt