Hosting a user control within a user control

  • Thread starter Thread starter Charlie@CBFC
  • Start date Start date
C

Charlie@CBFC

Hi:

When I drop one user control on to the design surface of another user
control I can't seem to get a reference to it. Using the following in host
control doesn't appear to work... protected MyUserControl MyUserControl1.
How do get ref so I can access it's properties?

Thanks,
Charlie
 
I think, you are only allowed to add a Web User Control to a Web Form Page.
Bishoy
 
Charlie,

You can do this. If you look at the html view of your page I think you'll
find that the user control's name is concatenated together with the number
of the host control.

For example:

I created a new user control, webusercontrol1.ascx and then dropped onto it
another new control webusercontrol2.ascx. When viewing the html of
webusercontrol1 webusercontrol2 appears with the id of webusercontrol12.

Just take a look at your html view and make certain you're declaring the
control with the same name it has on the page.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
Back
Top