I wonder if you have noticed that some website html code is mixed together, without any spaces, line breaks, and other extra characters. It is worth noting that the page size is absolutely optimized. Maybe you are thinking, they do this greatly reducing readability. Indeed, we are confused. We can only borrow third-party software to re-deploy the code. However, I think the source code they use during development cannot be mixed together. Recently, I found a page base class, which can probably explain this problem. Let's not talk about it. Let's look at the source code:
Copy codeThe Code is as follows:
Using System;
Using System. Data;
Using System. Configuration;
Using System. Web;
Using System. Web. Security;
Using System. Web. UI;
Using System. Web. UI. WebControls;
Using System. Web. UI. WebControls. WebParts;
Using System.Web.UI.html Controls;
Using System. Text. RegularExpressions;
Using System. IO;
/// <Summary>
/// PageBase Page Base Class
/// </Summary>
Public class PageBase: System. Web. UI. Page
{
Protected override void Render (htmlTextWriter writer)
{
StringWriter sw = new StringWriter ();
HtmlTextWriter htmlWriter = new htmlTextWriter (sw );
Base. Render (htmlWriter );
String html = sw. ToString ();
Html = Regex. Replace (html, "[f v]", "");
Html = Regex. Replace (html, "{2,}", "");
Html = Regex. Replace (html, "> [] {1}", "> ");
Writer. Write (html );
}
}