Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Link Validation

Link Validation

Scheduled Pinned Locked Moved Web Development
csharpwindows-adminhelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    german_aspnet
    wrote on last edited by
    #1

    Hi, I have a Web Project in .NET and I want to validate if a link really exists. This is why I need that: When users press a button in a web page, an external process is executed. This process generates a PDF file and returns the file name. This file is allocated in a site (http://xxx.xxx.xxx.xxx/report/filexxxx.pdf) by the external process. Then user press a "Refresh Button" in the web page and a link is automatically generated pointing to the generated file. The problem is that sometimes, the process don't generate any file, so when user clicks the link, he receives the message "The page cannot be displayed". Note: Web pages and PDF files are in different IIS. Thanks. I need to validate the link, so I wont show it if it doesn't exist. It is possible? Any idea?

    A 1 Reply Last reply
    0
    • G german_aspnet

      Hi, I have a Web Project in .NET and I want to validate if a link really exists. This is why I need that: When users press a button in a web page, an external process is executed. This process generates a PDF file and returns the file name. This file is allocated in a site (http://xxx.xxx.xxx.xxx/report/filexxxx.pdf) by the external process. Then user press a "Refresh Button" in the web page and a link is automatically generated pointing to the generated file. The problem is that sometimes, the process don't generate any file, so when user clicks the link, he receives the message "The page cannot be displayed". Note: Web pages and PDF files are in different IIS. Thanks. I need to validate the link, so I wont show it if it doesn't exist. It is possible? Any idea?

      A Offline
      A Offline
      aplope
      wrote on last edited by
      #2

      Seems to me you should use the System.IO class and then the File.Exists() method. For this method to work, you would need to know the file path for "http://xxx.xxx/report/". Once you know that and the file name, if File.Exists(FullFilename) then 'show file end if Pegmeister

      G 1 Reply Last reply
      0
      • A aplope

        Seems to me you should use the System.IO class and then the File.Exists() method. For this method to work, you would need to know the file path for "http://xxx.xxx/report/". Once you know that and the file name, if File.Exists(FullFilename) then 'show file end if Pegmeister

        G Offline
        G Offline
        german_aspnet
        wrote on last edited by
        #3

        The problem is that "http://xxx.xxx/report" is in a different physical machine that the one where the web pages are. I can access only by http to PDF files since they are outside my LAN. Thanks for your answer anyway. Germán.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups