request in namespace

Discussion in 'ASP .Net' started by martin, Dec 8, 2003.

  1. martin

    martin Guest

    Hi,

    I have created a namespace and a class as an additional project. I have made
    a referenece to my new namespace inside my web project and am happily using
    my new namespace. However I have one small problem.

    I wish to create a method inside my namespace to return the URL of the root
    of the site. To do this I need to use the methods


    request.servervarianle("SERVER_NAME ") and request.applicationpath()

    however these two functions are not availible from my namespace, even though
    I have imported seystem.web

    Please could somebody explain how I access the "request method " from a
    class, what namespace must I import, it lokks to me like this functionality
    is not allowed in a class..

    I am tryng to get the url to the root of my site

    for example

    http://www.mysite.com/ ---- if a website

    http://www.mysite.com/virtualroot/ -- if a virtual directory

    http://servername/ -- if a website on my local server

    http://servername/virtualroot/ if a virtual dir on my local server

    any help is appreciated.

    cheers

    martin.
    martin, Dec 8, 2003
    #1
    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. Èý¹â
    Replies:
    1
    Views:
    558
    William F. Robertson, Jr.
    Jul 29, 2003
  2. Brian Birtle
    Replies:
    2
    Views:
    1,996
    John Saunders
    Oct 16, 2003
  3. Replies:
    0
    Views:
    5,113
  4. Anonymous
    Replies:
    3
    Views:
    516
    Ron Natalie
    Aug 18, 2003
  5. Jason Heyes
    Replies:
    1
    Views:
    443
    Woebegone
    Nov 19, 2004
Loading...

Share This Page