relative and absolute path

Results 1 to 5 of 5

Thread: relative and absolute path

  1. #1
    DKL Guest

    Default relative and absolute path

    Hi,<BR><BR>I&#039;m new to ASP technology and wondering what is relative and absolute path while referring to folder structure. Also would like to know the "proper way" of identifying path for response.redirect so that it will work in IE as well as Netscape<BR><BR>Project1<BR>File1.asp<BR>---- Folder1<BR>--------File2.asp<BR>--------File3.asp<BR>---- Folder2<BR>--------File4.asp<BR>--------File5.asp<BR>1. What should be the URL/path for response.redirect while tranfering page from File1.asp to File2.asp<BR><BR>2. What should be the URL/path for response.redirect while tranfering page from File2.asp to File1.asp<BR><BR>3. What should be the URL/path for response.redirect while tranfering page from File2.asp to File3.asp<BR><BR><BR>Thanks<BR>

  2. #2
    Join Date
    Dec 1969

    Default Isn't relevant to the browser...

    ...response.redirect is server side.<BR><BR>Absolute path (ex. /myfolder/myfile.htm) forces the browser to start at the root of the website REGARDLESS of where in the site folder hierarchy you are at.<BR><BR>Relative path (ex. ../../myfolder/myfile.htm) uses the relative position of the file in the site folder hierarchy.<BR><BR>Personal, I always use absolute paths to avoid nesting problems with includes, stylesheets, images, etc...<BR><BR>I also use virtual directories (created in IIS) instead of relative addressed standard folder to house my ASP includes to avoid nesting issues as well.

  3. #3
    Join Date
    Dec 1969

    Default RE: relative and absolute path

    Absolute Path means you specify the complete path right from the root.Since your requested example is not suitable to explain the benefit of the subject let us assume you want to go to file2.asp from file5.asp then in absolute path you say Ex:<BR><BR>/folder1/file2.asp<BR><BR>where the first / is the root.<BR><BR>In case of relative path, you specify the path relative to your current position in the heirarchy of the folder you are in.<BR>the above example can be written as<BR><BR>../../folder2/file5.asp<BR><BR>.. represents up a directory level. so one .. takes you to folder1 then from there the other .. takes you to project1, then u said folder2/file5.asp.this will work everywhere.<BR><BR>Hope u understood the benefit of relative path.<BR><BR><BR>

  4. #4
    kannys ( the guru) Guest

    Default real world example

    absolute path to your house:<BR><BR>59 Whitton Avenue<BR>Birmingham<BR>England<BR>World<BR>Univer se<BR><BR>relative path to a guy standing around the corner from your house :<BR>turn right at the corner and the first house on the left.

  5. #5
    DKL Guest

    Default thanks Kanny ..ur few sentences have made the conc

    thanks Kanny ..ur few sentences have made the concept so clear

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts