0

请帮助我在使用 c# 代码下载文件后如何刷新或重定向到同一页面 请找到我在 c# 中使用的代码。

我使用下面的代码也有一些时间检查但没有工作。请给我文件下载后刷新页面的解决方案,因为我丢失了一些 mutipledropdownlist css 无法正常工作。

 string url = HttpContext.Current.Request.Url.AbsoluteUri;
 Response.AddHeader("Refresh", "3; url=" + url + "");
ScriptManager.RegisterStartupScript(this, this.GetType(), "onload", "javascript:location.reload(true);", true);
System.Web.UI.HtmlControls.HtmlMeta meta = new System.Web.UI.HtmlControls.HtmlMeta();
meta.Name = "Refresh";
meta.Content = "5;url=TCO.aspx";
this.Page.Header.Controls.Add(meta);
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment; filename=" + myfile.Name);
Response.AddHeader("Content-Length", myfile.Length.ToString());
Response.ContentType = "application/x-mspowerpoint";
Response.WriteFile(myfile.FullName);
Response.Flush();
Response.End();

谢谢普拉迪普
_

4

0 回答 0