I have an ASP.Net page where a visitor enters some information and clicks a button to downlod a pdf file.
Once the file has been downloaded I want to redirect the visitor to another website.
The file downloads fine, no problems there, however when I get to the Response.Redirect I get the error "Cannot redirect after HTTP headers have been sent." .
I ofcourse cannot use server.transfer since I am redirecting to a page that is not on the same server.
here is my code any suggestions anbody?
Protected Sub btnDownload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDownload.Click
Dim Fi As FileInfo = New FileInfo("c:\MyFile.pdf")
Response.ContentType = "application/pdf"
sition", "attachment; filename=MyFile.pdf" )
ile.pdf", 0, Fi.Length)
Catch ex As Exception