aspx代码中直接产生该页面的html输出
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
StreamWriter sw = null;
try
{
sw = new StreamWriter("c:\\test.htm",false,System.Text.Encoding.Default);
HtmlTextWriter myWriter = new HtmlTextWriter(sw);
base.Render (myWriter); //输出到文本文件
base.Render(writer); //页面输出
}
finally
{
if(sw != null)
{
sw.Close();
sw = null;
}
}
}
{
StreamWriter sw = null;
try
{
sw = new StreamWriter("c:\\test.htm",false,System.Text.Encoding.Default);
HtmlTextWriter myWriter = new HtmlTextWriter(sw);
base.Render (myWriter); //输出到文本文件
base.Render(writer); //页面输出
}
finally
{
if(sw != null)
{
sw.Close();
sw = null;
}
}
}
谢谢龙蜇 的思路.