ASP.NET/Opening PDF document in a new browser

G

Gabe

I have two web forms page1.aspx and page2.aspx. page1.aspx has one
button with the following event handler:

private void OnButtonClick(object sender, EventArgs e)
{
Response.Write("<script>window.open('page2.aspx')</script>");
}

page2.aspx writes a pdf document as follows in its Page_Load()

private void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.ContentType = "Application/PDF";
Response.WriteFile("c:\test.pdf");
Response.Flush();
Response.Close();
}

On Acrobat version 5.0, clicking that button on page1 opens a new
browser and pdf documents within that browser. On version 5.1 or
higher however, it opens up a blank window (no acrobat reader buttons
either - just blank page). Has anyone got this working? Is it
..NET/Acrobat reader bug? Or is there some settings that I need to set
in the reader itself?

Please send your answers to my e-mail ([email protected]) as well
as the group; thanks!

Gabe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top