How to get directory path of current rquest?

Discussion in 'ASP .Net' started by Olav Tollefsen, Oct 29, 2004.

  1. Olav Tollefsen, Oct 29, 2004
    #1
    1. Advertisements

  2. Olav Tollefsen wrote:
    > I have looked at the various attributes of the HttpRequest class, but I
    > didn't find an attribute to return the directory path to the current
    > request.
    >
    > Given the URL Http://www.contoso.com/virdir/page.html, I would like to have
    > a method to return:
    >
    > Http://www.contoso.com/virdir/
    >
    > Does anyone know how to achieve this?


    Olav, check out this blog entry from Rick Strahl -
    http://west-wind.com/weblog/posts/269.aspx

    This blog entry should be in everyone's bookmarks, as it's probably the
    best place to go to find out about determining path information in
    ASP.NET. He has some code posted in that entry that does precisely what
    you are looking for.

    Happy Programming!

    --

    Scott Mitchell

    http://www.4GuysFromRolla.com

    * When you think ASP.NET, think 4GuysFromRolla.com!
     
    Scott Mitchell [MVP], Oct 29, 2004
    #2
    1. Advertisements

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. PHaroZ
    Replies:
    5
    Views:
    97,677
    akash02sap
    Aug 17, 2012
  2. Tomek
    Replies:
    2
    Views:
    86,089
    Sandip Chitale
    Oct 2, 2003
  3. Matt
    Replies:
    1
    Views:
    27,728
    Sudsy
    Jun 6, 2004
  4. happy
    Replies:
    0
    Views:
    316
    happy
    Jan 14, 2005
  5. JK
    Replies:
    6
    Views:
    426
    Martin Honnen
    Sep 21, 2005
  6. Rodrigue Butaye

    get the path to the directory of the current user

    Rodrigue Butaye, Aug 15, 2003, in forum: Javascript
    Replies:
    0
    Views:
    258
    Rodrigue Butaye
    Aug 15, 2003
  7. Bob Walton
    Replies:
    9
    Views:
    327
    David K. Wall
    Sep 26, 2003
  8. moonhkt

    How to get current directory path

    moonhkt, Sep 1, 2009, in forum: Perl Misc
    Replies:
    6
    Views:
    930
Loading...