I have a button. When the user clicks on it, I want to call the download dialog, and then redirect the user to another page.
However, I am having problems loading and redirecting to work together. As soon as the download dialog appears, the rest of the code completes:
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 adding an update to the header, but it still doesn't work. I also tried javascript (but not using window.open ... as some browsers block this), but I can't get the redirect to work.
Any ideas? I really appreciate the help.
source
share