Author: nmathon | Posted on: 11/18/2008 9:17:32 AM | Views : 232

Hi,



I would like to partially render a page (retrieve HTML of some user
controls). I use this method in a web service which work pretty fine
but if myControl use a theme, theme is not applied in the rendered HTML.






C# :  StringBuilder output = new StringBuilder();
StringWriter strWriter = new StringWriter(output);
HtmlTextWriter tWriter = new HtmlTextWriter(strWriter);

System.Web.UI.Page pageHolder = new System.Web.UI.Page();
UserControl myControl= (UserControl )pageHolder.LoadControl("~/myControl.ascx");
pageHolder.Controls.Add(myControl);
pageHolder.Rende ...

Go to the complete details ...