Posted on: 11/20/2013 8:05:50 PM | Views : 698

Hi,
I need to load multiple user controls from code behind in a div that is also created from the code behind..
The problem is when I place the UserControl with a stringbuilder on the page, the UserControl is not loaded..
So to work arround this I've found a script, that wil create the user control..problem with this script is that it only create`s the last UserControl because the script make`s a new page everytime a UserControl needs to be loaded..Does anybody knows how to work arround this?
Here's some code:
[WebMethod] public static string LoadUserControl(string sUserControl) { try { using (Page page = new Page()) { UserControl userControl = (UserControl)page.LoadControl(sUserControl); page.Controls.Add(userControl); using (StringWriter writer = new StringWriter()) { HttpCon ...

Go to the complete details ...