Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends.
I have developed a User Control For Login.
Now I want to Load that User Control dynamically in Placeholder if User Click Sign in Button. How can i achieve this task.

If any body have Idea , Please suggest me.
Your suggestion will be highly appreciate.
Posted

Hi,

You just do like this in the sign in button click event:

C#
Control uc = LoadControl("YourLoginWebUserControl.ascx");
YourPlaceHolder.Controls.Add(uc);


And then, remember to re-create the control in the following postback's otherwise if the usercontrol was raising any button click events or so, they will not get fired in the code behind.

That's it :-)

Regards
Joachim
 
Share this answer
 
v3
the easiest way to do is to drag and drop the user control from the solution explorer panel to the content place holder of a page you want it to place. i hope itll give you an idea. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900