Fórmulas e Cenas

Object Reference Not Set to Instance of an Object

  Home  |   Contact  |   Syndication    |   Login
  40 Posts | 0 Stories | 7 Comments | 0 Trackbacks

News

Archives

Post Categories

Links

Today I will post some sample code to get the html thar is generated from an aspx. It's quite usefull to create emails, pdfs and so on.

Enjoy :)


Response.ClearContent();
StringWriter str = new StringWriter();

HtmlTextWriter htmlSTRINGWriter = new HtmlTextWriter(str);
this.RenderControl(htmlSTRINGWriter);

String myHtml = str.ToString();
posted on Friday, April 17, 2009 5:47 PM