M
Mike Griggs
Hi all
I've got a WebForm (WebForm1.aspx), to which I've added a PlaceHolder
(ph1). I'm programmatically adding a UserControl (MGUserControl.ascx)
to it, using LoadControl(). The control displays correctly, but if I
try and click on any of the buttons within the control, the events
never reach the event handlers in MGUserControl.ascx.
I've tried the following:
1. Setting an ID for the control (both declaratively and
programmatically, after the ph1.Controls.Add() call)
2. Setting a className in the HTML of MGUserControl.ascx
3. Adding a <% @reference %> link to WebForm1.aspx
and I think some other things, that I can't remember now. I'm
stumped. I know it's possible, but I'm just missing *something*.
I've RAR'd up the test project that I created, and put it at
http://server.griggs.org.uk/TestControls.rar. It's only 14k -
download that and have a peek, easier than me cutting and pasting all
of the code here.
I'd appreciate any help you can give
cheers
Mike
I've got a WebForm (WebForm1.aspx), to which I've added a PlaceHolder
(ph1). I'm programmatically adding a UserControl (MGUserControl.ascx)
to it, using LoadControl(). The control displays correctly, but if I
try and click on any of the buttons within the control, the events
never reach the event handlers in MGUserControl.ascx.
I've tried the following:
1. Setting an ID for the control (both declaratively and
programmatically, after the ph1.Controls.Add() call)
2. Setting a className in the HTML of MGUserControl.ascx
3. Adding a <% @reference %> link to WebForm1.aspx
and I think some other things, that I can't remember now. I'm
stumped. I know it's possible, but I'm just missing *something*.
I've RAR'd up the test project that I created, and put it at
http://server.griggs.org.uk/TestControls.rar. It's only 14k -
download that and have a peek, easier than me cutting and pasting all
of the code here.
I'd appreciate any help you can give
cheers
Mike