I have a report that I generate with HTML.
I'd like to get the HTML output of the page, and be able to send it via email. I'm having problem with session, because the report redirect me to the login page because when I create a new WebRequest, it doesn't use the information of the current session.
Is there a way to get the HTML of the re开发者_如何学运维port without having to code a work-around for the security ?
Thank you
This code get the job done
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter htmlTW = new HtmlTextWriter(sw);
RenderControl(htmlTW);
string html = sb.ToString();
精彩评论