Hosting a user control within a user control

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
 
B

Bishoy George

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

S. Justin Gengo

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top