PDA

View Full Version : PDF Viewer popup problems in IE7


NewMind
05-22-2008, 02:26 AM
I get the following error when trying to display a pdf in IE 7 ONLY; it works in FireFox nd IE6.

Here is the code I used to get it working (Hope this helps someone):


[quote]


try
{
Response.Clear();
Response.ClearHeaders();
Response.ClearContent();
Response.Buffer = false;
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "inline; filename=Report.pdf");
Response.AddHeader("Content-Length", pdf.Length.ToString());
Response.BinaryWrite(pdf); //pdf = ReportViewer report
Response.Close();
}
finally
{
Response.Close();
}</CODE>

Aristotle
05-22-2008, 08:19 AM
What was your code before?

Aristotle

DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)

NewMind
05-23-2008, 02:18 AM
[quote]

Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment; filename=Test.pdf");
Response.BinaryWrite(pdf);
Response.Flush();
Response.End();</CODE>

vvsharma
05-23-2008, 09:51 AM
Whats the error message?

Vikram

DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)