Skip to content

Instantly share code, notes, and snippets.

@acatejr
Last active August 29, 2015 14:09
Show Gist options
  • Save acatejr/9ea1dbe53500f915da87 to your computer and use it in GitHub Desktop.
Save acatejr/9ea1dbe53500f915da87 to your computer and use it in GitHub Desktop.
Changes an html control into an html string equivalent.
private static string WriteToHtml(HtmlContainerControl control)
{
var stringWriter = new StringWriter(new StringBuilder());
var htmlTextWriter = new HtmlTextWriter(stringWriter);
control.RenderControl(htmlTextWriter);
return stringWriter.ToString();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment