开发者

How to get HTML from a current request, in a postback

开发者 https://www.devze.com 2022-12-26 23:32 出处:网络
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 log

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();
0

精彩评论

暂无评论...
验证码 换一张
取 消