Reference a control on page from a custom control?

C

Chris Kettenbach

Good Morning,
I have a user control I dynamically load in the page_init event into a
asp:placeholder control. This page also has another placeholder I would
like to dynamically load controls into when the user takes an action on my
first dynamically loaded control.

Control 1 is a couple of asp:button controls. I am able to tap into their
events, but in the code behind, I want the click event of one of the buttons
to load another user control into the 2nd placeholder control on the page.
Does this make sense. I am sure it's some kind of "parent" or "page"
reference to reference placeholder #2. Also with I need to remove a
previosly loaded control from the placeholder when I wish to change the
control in it?

Any and all suggestions are welcome.

Kind Regards,
Chris
 
U

uttara

Chris,
Yours is a ver common situation. What you need to do is raise an event
on button click in Control 1, which you should handle on the parent
page. From here you can hide control 1 and load Control 2 (placeholder #2).
Uttara
 

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

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top