Yes, I found that I needed to add an EventHandler in the UserControl code behind file and add a handler on the main.aspx.vb codebehind for the dynamicly added usercontrol
Thanks
Mike
----- ccallen wrote: ----
Mike
Did you get this working yet
I am doing the same thing as you, although I ran into a different set o
problem
(mostly compiler errors). Once I worked through the compiler errors th
events worked fine (both in the placeholder method and the regular way)
The pagelet samples in the .net sdk has an example of doing this using th
non-code behind method (Pagelet7). There is vstudio tree with a code behin
versions of the pagelet samples, however they do not use a PlaceHolder, the
add to the Page object itself
To get code-behind + PlaceHolder approach to work, I got the non-codebehin
version working. Created a new webform and web user control, pasted the cod
into the codebehind files. I had to add a reference to the place holder i
the web form's codebehind module. The event handlers also had to be prefixe
with public as well
I can post my example code if you (or anyone else) are insterested
ccalle
MikeM said:
I am having a problem of receiving UserControl events which gets dynamicl
loaded within a Placeholder on a main.aspx page. If I explictly plac
"myControl" on the main.aspx page I can receive events and act on them, bu
when I dynamicly load "myControl" within a Placeholder in main.aspx.v
code-behind I can not find a way to get the events for these control
contained within the Placeholder. I am using the Placeholder on th
main.aspx page for layout and because the number of usercontrols loaded wil
vary