locked
Convert URL path RRS feed

  • Question

  • User1813431199 posted

    Hi

    i have a problem, this is the ubication of a image file on web application "~/SlideShow/images/Blue hills.jpg" but i need the path of the folder navigation in actually aspx,

    i need convert to this path "../../SlideShow/images/Blue hills.jpg" because i have aspx in "Knowledge/APP/Default.aspx" and the image is in  "SlideShow/images/Blue hills.jpg"

    how convert for any ubication

     

    sorry my english =(

    Sunday, April 6, 2008 9:54 PM

Answers

  • User113421904 posted

    Hi Pablogrind,

    If you means relative path from ASP.NET Web Forms to the image, just Drag And Drop the image from Solution Explorer to the Design View of the page in Visual Studio/Visual Web Developer. Visual Studio/Visual Web Developer will generate the relative path for you. For example, this is what I get after Drag & Drop of sample.jpg file.

    <img src="../../folder1/subfolder1/sample.jpg" />

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 9, 2008 10:59 PM

All replies

  • User1712388314 posted

    Try to use

    Server.MapPath("~/SlideShow/images/Blue hills.jpg");
     will give you always relative path to your sources
    Monday, April 7, 2008 12:45 AM
  • User1813431199 posted

    Thanks nKognito for reply but when i try

    HttpContext.Current.Server.MapPath("~/SlideShow/images/Blue hills.jpg");  Return

    "C:\\Documents and Settings\\Administrador\\SampleWebSite\\SlideShow\\images\\Blue hills.jpg"

    And i need the path according  to the actually ubication of aspx in this form "../../SlideShow/images/Blue hills.jpg"

    To accede from this ubication of aspx to the ubication of the image

    Monday, April 7, 2008 1:01 AM
  • User113421904 posted

    Hi Pablogrind,

    If you means relative path from ASP.NET Web Forms to the image, just Drag And Drop the image from Solution Explorer to the Design View of the page in Visual Studio/Visual Web Developer. Visual Studio/Visual Web Developer will generate the relative path for you. For example, this is what I get after Drag & Drop of sample.jpg file.

    <img src="../../folder1/subfolder1/sample.jpg" />

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, April 9, 2008 10:59 PM