请教怎么将ASP.NET生成静态页面

请问如何将ASP.NET生成静态页面?
请问如何将asp.net生成静态的HTML页面。找了很久只看到用模板生成单个页面。以下有几个小问题。
1,请问如何做到将整站转成HTML的页面?
2,如果有分页的话我都是用到了网上其他人写的AspNetPager这个控件去分页,而这个分页有什么办法可以将里面的一页一页生成静态的页面?
有否源代码?
请高手指点下迷津,在下不胜感激。

------解决方案--------------------
public static bool WriteFile(string strText,string strContent,string strAuthor)
{
string path = HttpContext.Current.Server.MapPath( "/news/ ");
Encoding code = Encoding.GetEncoding( "gb2312 ");
// 读取模板文件
string temp = HttpContext.Current.Server.MapPath( "/news/text.html ");
StreamReader sr=null;
StreamWriter sw=null;
string str= " ";
try
{
sr = new StreamReader(temp, code);
str = sr.ReadToEnd(); // 读取文件
}
catch(Exception exp)
{
HttpContext.Current.Response.Write(exp.Message);
HttpContext.Current.Response.End();
sr.Close();
}


string htmlfilename=DateTime.Now.ToString( "yyyyMMddHHmmss ")+ ".html ";
// 替换内容
// 这时,模板文件已经读入到名称为str的变量中了
str =str.Replace( "ShowArticle ",strText); //模板页中的ShowArticle
str = str.Replace( "biaoti ",strText);
str = str.Replace( "content ",strContent);
str = str.Replace( "author ",strAuthor);
// 写文件
try
{
sw = new StreamWriter(path + htmlfilename , false, code);
sw.Write(str);
sw.Flush();
}
catch(Exception ex)
{
HttpContext.Current.Response.Write(ex.Message);
HttpContext.Current.Response.End();
}
finally
{
sw.Close();
}
return true;

此函数放在Conn.CS基类中了
在添加新闻的代码中引用 注:工程名为Hover

if(Hover.Conn.WriteFilethis.Title.Text.ToString),this.Content.Text.ToString),this.Author.Text.ToString)))
{
Response.Write( "添加成功 ");
}
else
{
Response.Write( "生成HTML出错! ");
}
-------------------------------------
模板页Text.html代码
-------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN " >
<HTML>
<HEAD>
<title> ShowArticle </title>
<body> biaoti
<br>
content <br>
author
</body>
</HTML> ------------------------------------
------解决方案--------------------
通过在basePage重载OnInit方法(判断aspx对应的静态页面是否存在,来决定是生成还是重定向)和Render方法(到这里了可以确定页面是不存在的,所以把要生成的内容流存到静态页面中去,而不是直接render到客户浏览器,最后重定向)。在内容没有更新时,页面请求都会被OnInit重定向到静态页面(也可以确定是最新内容)。当有内容更新的同时,删除内容相关的所有静态页面(可动态配置),达到更新静态页面的目的。另外注意一点的是,我的实际使用中,因为不同页面定位的路径不一样,所以我写了一个BasePage,还有多个moduleBasePage,最后页面是继承的moduleBasePage,我想你也会遇到一样的问题。