我希望用户能够下载页面

Lee*_*ema 1 c# asp.net

我正在使用代码,

    string loadFile = HttpContext.Current.Request.Url.AbsoluteUri;
    // this.Response.ClearContent();
    // this.Response.ClearHeaders();
    this.Response.AppendHeader("content-disposition", "attachment; filename " + filename);
    this.Response.ContentType ="application/html";

    this.Response.WriteFile("C:\\Users\\Desktop\\Jobspoint Website\\jobpoint3.0\\print.aspx");
    this.Response.Flush();
    this.Response.Close();
    this.Response.End();
Run Code Online (Sandbox Code Playgroud)

在asp.net C#下载一个aspx页面..但它只显示html标签和静态值...如何在没有html标签和从数据库中检索的值的情况下保存整个页面?
谢谢......
Leema

Pan*_*hra 5

使用WebClient进行此操作.它会下载你的文件.