Excel导出后更新ASP.NET页面

我正在使用Response.Write,Response.End导出到Excel / Word / csv。 有没有办法做到这一点,也能够同时更改页面上的文字? 例如,我有一个UpdatePanel内的控件,我想使其可见/不可见。

通过AJAX动作更新你的页面,并在这个过程中,写出一些JavaScript调用一个单独的页面/处理程序,实际导出。

if (exporting) { string cacheID = Guid.NewGuid().ToString(); Session[cacheID] = ...data or query to export... ScriptManager.RegisterStartupScript(Page, Page.GetType(), cacheid, "window.location = '/download.ashx?cacheid=" + cacheID + "';", True); }