View PDF in IE, delete back back back 2 pages

A bit new to asp.net using c #. On my site, users have the ability to view the pdf file in a browser window. The pdf data is stored in a SQL database and I am using the following code:

Byte[] bytes = (Byte[])dt.Rows[0]["ContentData"];
    Response.ClearHeaders();
    Response.Clear();
    Response.AddHeader("Content-Type", "application/pdf");
    Response.AddHeader("Content-Length", bytes.Length.ToString());
    Response.AddHeader("Content-Disposition", "inline; filename=" + dt.Rows[0]    ["FileName"].ToString());
    Response.BinaryWrite(bytes);
    Response.Flush();
    HttpContext.Current.ApplicationInstance.CompleteRequest();

      

The problem I only ran into in Internet Explorer is when the user clicks the Back button, it moves 2 pages. This is not critical, but it annoys users. I apologize if this was asked, but I am having trouble with searches to find the problem.

Any help is appreciated. Thank.

csnewbie

+3
c # internet-explorer asp.net


source to share


No one has answered this question yet

Check out similar questions:

1424
How to fix "The breakpoint will not be removed at this time. No symbols have been loaded for this document." warning?
637
How to import namespace in Razor view page?
523
How to get url of current page in C #
12
PDF creation bug with IE and HTTPS
7
Response.AddHeader ("Content-Disposition") won't open file in IE6
2
Asp.Net Sending PDF to Browser
0
ASP.NET MVC FilePathResult error in IE
0
Failed to save render PDF in chrome - Perl
0
ITextSharp - Google Chrome save button saves PDF as .ASPX page
0
Inconsistency in file before and after loading into Oracle DB



All Articles
Loading...
X
Show
Funny
Dev
Pics