Protected override void render (htmltextwriter writer)
{
// Compress the HTML to be output before outputting it
Stringwriter html = new stringwriter ();
Htmltextwriter Tw = new htmltextwriter (HTML );
Base. Render (TW );
String outhtml = html. tostring ();
Outhtml = RegEx. Replace (outhtml, "\ s + ","");
Outhtml = RegEx. Replace (outhtml, ">\\ S + <", "> <");
Outhtml = outhtml. Trim ();
Writer. Write (outhtml );
}
Protected override void render (htmltextwriter writer)
{
// Before the final output, the file is saved as an HTML file. If the latest information is published, you can open default. aspx once and then generate another HTML file.
// This is the default render implementation and is directly output to writer.
// base. render (writer);
stringwriter html = new stringwriter ();
htmltextwriter Tw = new htmltextwriter (HTML);
// use base. the render () method writes the generated HTML to our defined TW
base. render (TW);
string Path = server. mappath ("index.html");
streamwriter Sw = new streamwriter (path, false, system. text. encoding. default);
// write to file
SW. write (HTML. tostring ();
SW. close ();
// write to writer to output HTML of the page
// note that base cannot be called here. render (writer), error
writer. write (HTML. tostring ();
}