I have a button. When the user clicks it, I want to trigger a download dialog box, and then redirect the user to another page.
However, I'm having problems getting the download and redirect to run together. Once the download dialog box is shown, execution on the rest of the code seems to end:
Sub DisplayDownloadDialog(ByVal filepath As String)
Dim filename As String = Path.GetFileName(filepath)
Response.ContentType = "application/octet-stream"
Response.AddHeader("Content-Disposition", "attachment; filename=""" & filename & """")
Response.WriteFile(filepath)
End Sub
I tried to add a refresh to the header, but it still doesn't work. I also tried javascript (but not using window.open...since some browsers block that), but I can't get a redirect to work.
Any ideas? I really appreciate the help.