ASPX被发布到客户端浏览器不就是HTML了吗?

解决方案 »

  1.   

    是的,你看到了,你也可以把它手工的存为html,可是你如何自动的,用程序把aspx存为html呢?存在客户端和服务器端有什么不同吗?
      

  2.   

    write some automation code to access your page and save the response
    or override Render method to save the output, for example (make sure to give ASPNET account write permissions in the current directory)
    protected override void Render(HtmlTextWriter output)
    {
        StringWriter sw;
        HtmlTextWriter htmltw;
        sw = new StringWriter();
        htmltw = new HtmlTextWriter(sw);
        base.Render(htmltw);    String sTemp = sw.ToString();    StreamWriter writer = File.CreateText(Server.MapPath("somehtml.html"));
    writer.Write(sTemp);
    writer.Close();    //write it out to the browser
        output.Write(sTemp);
    }
      

  3.   

    这里有一个相当详细的例子,不过是把结果用email送出去,改改应该可以用:
    http://aspnet.4guysfromrolla.com/articles/091102-1.aspx