Response.End

Last post 07-28-2003, 3:07 PM by tbjerstedt. 4 replies.
Sort Posts: Previous Next
  •  06-17-2003, 5:50 PM 716

    Response.End

    When saving my pdf object to the Response object, when I use this code:
    ...
    pdf.Save(Response);
    Response.End();

    The pdf loads great, but when I hit back in my browser, it goes back two pages in my history. If I leave off the Response.End(), instead of just loading the pdf, I get a dialog asking if I want to Open or Save the document. When I select Open, I get an error that says:

    "The file referenced by the shortcut file 'C:\...' can not be opened."

    My preference is for the pdf to load without having to select open, and that if I hit back, I'll go back to the page from which I generated the pdf.

    Any ideas?

    Pete
     
  •  06-17-2003, 6:55 PM 722 in reply to 716

    Re: Response.End

    Dear Pete,

    Thanks for your consideration.

    Please look at the Aspose.Pdf demos. In the demos, you can go back to the page from which you generated the pdf if you hit back.

    Tommy Wang
    Lead Developer
    Aspose Changsha Team
    About Us
    Contact Us
     
  •  06-18-2003, 8:24 AM 734 in reply to 716

    Re: Response.End

    Is it possible that you are writing other stuff to the response before or after the pdf.Save?

    When writing the PDF for display, it is important to not have any other non-PDF bytes in the response stream.

    Our code uses the pdf.Save(response) and it works correctly without using a response.end.
     
  •  07-28-2003, 12:09 AM 1072 in reply to 734

    Re: Response.End

    I'm not explicitly writing anything else to the response before or after the pdf.Save. Is there a way that I might be implicitly writing more to the response that I can check out?
     
  •  07-28-2003, 3:07 PM 1075 in reply to 1072

    Re: Response.End

    We had a similar problem and there are several possiblities to check.

    1) Does the ASPX form contain any HTML? By default, Visual Studio includes opening and closing HTML. When I created our online display pages, I went in and removed all ot the data (including whitespace from the page.)

    2) Does your ASPX page inherit from a page which adds header and footer information? (Our code broke when we changed the page to inherit from a base page to add security and the base page was adding page headers and footers. We had to change the code to allow header and footer rendering to be shut off.)
     
View as RSS news feed in XML