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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Truly Relative Pathz

Truly Relative Pathz

Scheduled Pinned Locked Moved ASP.NET
csharpsysadmin
2 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.
  • A Offline
    A Offline
    Andrew S Kloos
    wrote on last edited by
    #1

    I would like to configure a web project with truly relative file and image pathz. regardless of server name or application name. I used to use"../dir_name/file_name" however an organizational shift forced me to move my entire directory structure down one level. instead of modifying "../dir_name/file_name" to "../../dir_name/file_name" i was attempting to use something like... [and ![](<%=Request.ApplicationPath%>/images/image_file.jpg)/Images/image_file.gif"> I again get nothing but if I set ImageUrl in the c# code behind using a variation of the line above it workz. Can anyone explain either which part of my syntax is wrong or why you can use this function sometimes but not other times. Thanks, D](<%=Request.ApplicationPath%>/Public/Home.aspx)

    K 1 Reply Last reply
    0
    • A Andrew S Kloos

      I would like to configure a web project with truly relative file and image pathz. regardless of server name or application name. I used to use"../dir_name/file_name" however an organizational shift forced me to move my entire directory structure down one level. instead of modifying "../dir_name/file_name" to "../../dir_name/file_name" i was attempting to use something like... [and ![](<%=Request.ApplicationPath%>/images/image_file.jpg)/Images/image_file.gif"> I again get nothing but if I set ImageUrl in the c# code behind using a variation of the line above it workz. Can anyone explain either which part of my syntax is wrong or why you can use this function sometimes but not other times. Thanks, D](<%=Request.ApplicationPath%>/Public/Home.aspx)

      K Offline
      K Offline
      Kschuler
      wrote on last edited by
      #2

      I don't have time to test out my theory, but I'm guessing that to do this in the html you would have to do it like this: ImageURL=<%=Request.ApplicationPath & "/Images/image_file.gif"%> Or some variation of this. Hope this helps.

      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