Dynamically loading user control from current control

D

davidr

Hi,

I been stuck on this for a week or more. So please help!

I have a menu were a user can click a button and a user control is
loaded into the page. A problem occurs when trying to load a user
control after an event from the CURRENT CHILD USER CONTROL. I put that
in caps because I need to make clear that the postback event is
happening from a child user control click button event. So, After the
Page Load happens on the current page and reloads the current user
control, it then goes into the page Load for that current user control
and then it goes into the Click Button event. Inside this Click Button
event I am use reflection to call a LoadUserControl(controlName) method
that loads a new user control into the parent page. It is loading this
control into a panel so that way its always inside the <form> tags.
Well, I am getting the error "The control must be placed inside a form
tag with runat=server." Which I don't understand why? I remove the
current user control before loading in the new one. Is it just not
possible to load a new user control into the parent page from the
CURRENT CHILD USER CONTROL?

Thanks,

David
 

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,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top