Redirecting to another page after Response.End() has been called in C#

前端 未结 6 2026
一生所求
一生所求 2020-12-11 17:48

I am exporting a gridview to excel, using .Net 4.0 in a web application, on page load and need for the file to be generated and then the page to be redirected to the calling

6条回答
  •  隐瞒了意图╮
    2020-12-11 18:28

    I suggest to add a redirect header. Something like this:

    Response.AddHeader("Refresh", "3; url=index.html");
    

    Where 3 is time of the delay and index.html is url you need to redirect to

提交回复
热议问题