Andrew is right about Response.End termination. I donβt think that removing this will help, however, since it will just affect the file you are sending.
You can get the effect you want with other tricks. For example, you can use some JS on a page with a DL link to perform client-side redirection.
change
What I suggest is that you add secondary behavior to your download link in order to click on it, and downloads the file, and modifies the current page. This might work better if a click starts a timer that redirects after a second or so.
source share