Previously said to use HttpModule to change cookies before response, today encountered ASP.net to do their own ideas, I have to work hard to convert the Chinese characters ꪻ such a manifestation, and turn into Chinese characters, not to mention the ASP.net Web control, is the HTML control ranat= The server will be forcibly converted into Chinese character output.
If the page content line with response write out, that is too tired, and error prone. So the best way to do this is to do a conversion once the asp.net is done, so that asp.net takes you out of the way.
asp.net all of the build actions are done in the Render method, then we operate on the Render method:
StringWriter SW = new StringWriter ();
HtmlTextWriter HTMLW = new HtmlTextWriter (SW);
Take out the page generated content
Base. Render (HTMLW);
HTMLW. Flush ();
HTMLW. Close ();
string pagecontent = sw. ToString ();
Make changes to the content
PageContent = Killthebugandshit (pagecontent);
Response.Write (PageContent);
Base. Render (writer);
}
Using this method, you can also take the content generated by the page to generate a static page to use.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.