sama
sama

Reputation: 113

how to load PDF file in website page using C#

how to load PDF file in website page using C#

Upvotes: 2

Views: 909

Answers (1)

kemiller2002
kemiller2002

Reputation: 115488

Here is how you send a file to the browser.

http://support.microsoft.com/kb/306654

private void Page_Load(object sender, System.EventArgs e)
    {
             //Set the appropriate ContentType.
        Response.ContentType = "Application/pdf";
             //Get the physical path to the file.
        string FilePath = MapPath("acrobat.pdf");
             //Write the file directly to the HTTP content output stream.
        Response.WriteFile(FilePath);
            Response.End();
    }

Upvotes: 3

Related Questions