how to call user control dynamically

Posted by Praveen7k under ASP.NET AJAX on 3/2/2011 | Points: 10 | Views : 5986 | Status : [Member] | Replies : 3
i have two ascx pages as partlist.ascx,comments.ascx
i have to add partlist.ascx ( it gas 2 button save,cancel ) in home.aspx
and when ic click a button ( save from partlist.ascx ) in home.aspx it sholud open like a popup comments.ascx asyncronously




Responses

Posted by: SheoNarayan on: 3/2/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
You can load user control dynamically by writing Page.load method (http://www.dotnetfunda.com/interview/exam187-how-to-load-a-user-control-dynamically-in-runtime-.aspx ) however in your case you can simply keep the comments.ascx into a separate page and open that page in popup window (through JavaScript) when button is clicked.

Hope this helps

Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Praveen7k, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mcadeepuraj on: 3/2/2011 [Member] Starter | Points: 25

Up
0
Down
i think user control can be intialize at page.initiate method

Deepak Kumar

Praveen7k, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 3/3/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Hi,

Check this link... You will get an idea on how to add and remove a user control dynamically...

http://www.codeproject.com/KB/user-controls/DynamicUC.aspx

Thanks
Karthik
www.f5Debug.net

Praveen7k, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response