static pages implemented by oninit and render must be reloaded to generate
but read and write classes
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. htmlcontrols;
using system. io;
///
// change abstract description
///
public class change: system. web. UI. page
{< br> protected string filename;
protected override void oninit (eventargs e)
{< br> int COUNT = request. URL. absolutepath. length;
filename = request. URL. absolutepath. remove (count-4, 4) + "htm"; // remove the suffix aspx
If (file. exists (server. mappath (filename)
{< br> file. delete (server. mappath (filename);
}< BR >}
protected override void render (htmltextwriter writer)
{< br> stringwriter html = new stringwriter ();
htmltextwriter Tw = new htmltextwriter (HTML );
base. render (TW);
streamwriter Sw = new streamwriter (server. mappath (this. filename), false, system. text. encoding. utf8);
SW. write (HTML. tostring ();
SW. flush ();
SW. close ();
TW. close ();
response. write (HTML. tostring ();
}< BR >}< br> to generate a static page, you only need to inherit this class (change) you can generate a static page with the same name as a dynamic page under your website path. It is a static page.