日期:2014-05-17 浏览次数:20657 次
?protected override void Render(HtmlTextWriter writer)
{
System.IO.StringWriter html = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter tw = new HtmlTextWriter(html);
base.Render(tw);
System.IO.StreamWriter sw = new System.IO.StreamWriter(Server.MapPath("index.html"), false, System.Text.Encoding.Default);
sw.Write(html.ToString());
sw.Close();
tw.Close();
Response.Write("页面生成成功!");
}
将以上上函数数加如到你要生成静太文件的页面里,
函数从载了,Render函数 作用是把页面的 html文本截下来,保存到文件里,