Asp.net| page
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:
protected override void Render (HtmlTextWriter writer)
{
StringWriter sw = new StringWriter ();
HtmlTextWriter HTMLW = new HtmlTextWriter (SW );
//Take out the page-building content
base. Render (HTMLW);
HTMLW. Flush ();
HTMLW. Close ();
string pagecontent = sw. ToString ();
//modify content
&nbSp 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.
(as if I had written this post last year ...) No, I don't remember.