我试图在点击按钮后自动下载文件后显示成功消息(在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中显示成功消息?