Open PDF File from Hyperlink control

Discussion in 'ASP .Net' started by =?Utf-8?B?TWlrZQ==?=, Sep 30, 2007.

  1. Hi. I see a lot of threads regarding this, but none of them seem to present a
    solution.

    How can I open a PDF document (located outside of the web application), via
    a Hyperlink control. Currently I'm setting the NavigateURL property of the
    hyperlink equal to the network path to the document, but this doesn't work.

    Can anyone offer a solution?

    Thanks
    Mike
    =?Utf-8?B?TWlrZQ==?=, Sep 30, 2007
    #1
    1. Advertising

  2. You cannot point to a network location if you are using a drive designation.
    If this is an Intranet application, you can use a UNC, but I would not go
    this direction unless every person hitting the site has access to that drive
    location, or it will break for some.

    If you are trying to display a file on the web server, but outside of the
    file directory, you would be best to do a google search for creating a file
    server or file serving page, or something similar. The basic idea here is
    set the MIME type to the correct type for the file you are serving and then
    stream out the bits. I will see if I can find a link a bit later.

    I saw someone recently who was trying to copy files to a web directory and
    link, but that is not the best solution.

    One other option is to create a virtual directory in IIS that points to the
    file location (if on that server) and link as if it was part of the website.
    That works, but you will also have to give access to the web user or it will
    not serve the file. You can then use the Membership bits from ASP.NET to
    secure the file(s), if necessary.

    --
    Gregory A. Beamer
    MVP, MCP: +I, SE, SD, DBA

    *************************************************
    | Think outside the box!
    |
    *************************************************
    "Mike" <> wrote in message
    news:...
    > Hi. I see a lot of threads regarding this, but none of them seem to
    > present a
    > solution.
    >
    > How can I open a PDF document (located outside of the web application),
    > via
    > a Hyperlink control. Currently I'm setting the NavigateURL property of
    > the
    > hyperlink equal to the network path to the document, but this doesn't
    > work.
    >
    > Can anyone offer a solution?
    >
    > Thanks
    > Mike
    Cowboy \(Gregory A. Beamer\), Sep 30, 2007
    #2
    1. Advertising

  3. "Mike" <> wrote in message
    news:...

    > How can I open a PDF document (located outside of the web application),
    > via
    > a Hyperlink control. Currently I'm setting the NavigateURL property of
    > the
    > hyperlink equal to the network path to the document, but this doesn't
    > work.


    That's right - NavigateURL, as its name suggests, needs a URL e.g.
    http://.........

    > Can anyone offer a solution?


    Move the PDF into the virtual directory, or place it in a location which is
    accessible via a URL...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
    Mark Rae [MVP], Sep 30, 2007
    #3
  4. Hi Mike,

    I asked a similar question a couple of weeks back, and got some really good
    responses/answers.

    Here's the thread (watch the wrap):
    http://groups.google.com/group/micr...a5472543e94?lnk=st&q=&rnum=1#9a470a5472543e94

    hth,
    Brian

    "Mike" <> wrote in message
    news:...
    > Hi. I see a lot of threads regarding this, but none of them seem to
    > present a
    > solution.
    >
    > How can I open a PDF document (located outside of the web application),
    > via
    > a Hyperlink control. Currently I'm setting the NavigateURL property of
    > the
    > hyperlink equal to the network path to the document, but this doesn't
    > work.
    >
    > Can anyone offer a solution?
    >
    > Thanks
    > Mike
    Brian Simmons, Oct 1, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Carl Prothman [MVP]

    Re: Open linked PDF-Files from a PDF-File

    Carl Prothman [MVP], Aug 9, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    456
    Paul Kuebler
    Aug 12, 2003
  2. Paul Kuebler

    Open linked PDF-Files from a PDF-File

    Paul Kuebler, Aug 12, 2003, in forum: ASP .Net
    Replies:
    8
    Views:
    449
    Carl Prothman [MVP]
    Aug 18, 2003
  3. Daniel Geisenhoff
    Replies:
    1
    Views:
    6,195
    Steven Cheng[MSFT]
    Apr 16, 2004
  4. Ricardo Pog
    Replies:
    1
    Views:
    401
    Austin Ziegler
    Mar 26, 2008
  5. mistral
    Replies:
    6
    Views:
    251
    Thomas 'PointedEars' Lahn
    Jul 13, 2008
Loading...

Share This Page