I am trying to make a user control into a string. The application is configured so that the user can use tokens, and user controls are displayed where tokens are found.
StringBuilder sb = new StringBuilder(); StringWriter sw = new StringWriter(sb); HtmlTextWriter writer = new HtmlTextWriter(sw); Control uc = LoadControl("~/includes/HomepageNews.ascx"); uc.RenderControl(writer); return sb.ToString();
This code displays the control, but none of the events raised in the Page_Load of the control fires. There should be a repeater in control.
craigmoliver
source share