Redirecting a page after a PDF download

后端 未结 5 1225
耶瑟儿~
耶瑟儿~ 2020-12-11 07:55

I have an aspx (say 1.aspx) page from where first I am downloading a pdf file and then I want to redirect to some Thanks.aspx page. The code is this:

protect         


        
5条回答
  •  悲哀的现实
    2020-12-11 08:38

    In HTTP, a request can only have a single response. Since the first response is the PDF file, the seconds response (i.e. the redirect) cannot be implemented.

    You can try to redesign the two pages by redirecting to thanks.aspx and have thanks.aspx start the download automatically.

提交回复
热议问题