【问题标题】:doc file download c# enabling buttonsdoc文件下载c#启用按钮
【发布时间】:2018-12-13 11:24:48
【问题描述】:
 protected void btnPrint_Click(object sender, EventArgs e)
{
 Response.ContentType = "Application/doc";
 Response.AppendHeader("Content-Disposition", "attachment;filename=xyz.doc");
 Response.TransmitFile(Server.MapPath("~/x/xyz.doc"));
 Response.End();
 btnProceed.Enabled = true;//not working
}

服务器端控件属性在此代码块中不起作用。如何在同一代码块内完成文件下载后启用按钮。

【问题讨论】:

    标签: c# asp.net servercontrols


    【解决方案1】:

    下载后,您要么必须重新加载启动下载的页面,要么使用 UpdatePanel 进行更新,或者使用一些 JavaScript 魔法在客户端完全完成。

    【讨论】:

    猜你喜欢
    • 2018-03-07
    • 2012-04-05
    • 2020-10-10
    • 2019-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多