在asp.net中自动下载文件后,HTML没有更改

时间:2013-12-17 15:22:29

标签: asp.net http-headers download

我试图在点击按钮后自动下载文件后显示成功消息(在PostBack之后)。代码是:

divMessage.InnerHtml = "Your download should start automatically. If it doesn't, click <a alt='" +
                                       DownloadObject.Title + "' href='" +  DownloadObject.Url + "' target='_blank'>here</a>";
divMessage.Attributes.Add("class", "alert alert-success");



//Start downloading the file automatically
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment;filename=" + downloadableFileUrl.TrimStart('/'));

Response.TransmitFile(DownloadObject.Url);
Response.End();

HTMl没有任何反应,但文件已成功下载。是否有任何解决方法可以在UI中显示成功消息?

0 个答案:

没有答案