I have download button which after download i want to redirect to another page.
Response.ContentType = "application/pdf";
Response.AddHeader("Content-Disposition", "attachment; filename=downloadfile.pdf");
Response.TransmitFile(Server.MapPath("downloadfile.pdf"));
Response.AddHeader("Refresh", "3;URL=redirectpage");
This is the code for downloading the file, right now after downloading the file is not redirecting to the page i want to redirect.
Depending on how the request for the file is made, you may want to consider using some client-side code to perform the redirection. A small example of a file download requested from a hyperlink can can be found here:
This example redirects after starting the file download.
You could also redirect then initiate the download as show here (context is with PHP but solution is HTML-based and JS-based)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.