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. Advertising

  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. Advertising

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:
    95,661
    akash02sap
    Aug 17, 2012
  2. Tomek
    Replies:
    2
    Views:
    85,060
    Sandip Chitale
    Oct 2, 2003
  3. Matt
    Replies:
    1
    Views:
    27,495
    Sudsy
    Jun 6, 2004
  4. happy
    Replies:
    0
    Views:
    244
    happy
    Jan 14, 2005
  5. JK
    Replies:
    6
    Views:
    248
    Martin Honnen
    Sep 21, 2005
Loading...

Share This Page