How to return the current page URL

Discussion in 'ASP .Net' started by Dan, Dec 13, 2005.

  1. Dan

    Dan Guest

    I'm having trouble getting the current page URL into a local string
    variable.
    I've tried using the System.Security.Policy.URL.Value but I get the message
    "Reference to non-shared member requires an object reference"
    I've searched the help files and online for a vb sample but found none. I
    have found samples to parse the URL parameters but they all show the URL
    already in a string variable.

    Thanks,
    Dan
     
    Dan, Dec 13, 2005
    #1
    1. Advertising

  2. Dan

    Karl Seguin Guest

    I think you want to take a look at the Request.Url class, specifically
    Request.Url.AbsolutePath and maybe the array Request.Url.Segments

    Karl

    --
    MY ASP.Net tutorials
    http://www.openmymind.net/


    "Dan" <> wrote in message
    news:e9auGY$$...
    > I'm having trouble getting the current page URL into a local string
    > variable.
    > I've tried using the System.Security.Policy.URL.Value but I get the
    > message
    > "Reference to non-shared member requires an object reference"
    > I've searched the help files and online for a vb sample but found none. I
    > have found samples to parse the URL parameters but they all show the URL
    > already in a string variable.
    >
    > Thanks,
    > Dan
    >
    >
     
    Karl Seguin, Dec 13, 2005
    #2
    1. Advertising

  3. Dan

    Dan Guest

    That's exactly what I was looking for. Thank You!

    "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
    wrote in message news:e05gIo$$...
    > I think you want to take a look at the Request.Url class, specifically
    > Request.Url.AbsolutePath and maybe the array Request.Url.Segments
    >
    > Karl
    >
    > --
    > MY ASP.Net tutorials
    > http://www.openmymind.net/
    >
    >
    > "Dan" <> wrote in message
    > news:e9auGY$$...
    > > I'm having trouble getting the current page URL into a local string
    > > variable.
    > > I've tried using the System.Security.Policy.URL.Value but I get the
    > > message
    > > "Reference to non-shared member requires an object reference"
    > > I've searched the help files and online for a vb sample but found none.

    I
    > > have found samples to parse the URL parameters but they all show the URL
    > > already in a string variable.
    > >
    > > Thanks,
    > > Dan
    > >
    > >

    >
    >
     
    Dan, Dec 13, 2005
    #3
    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. Jon paugh
    Replies:
    1
    Views:
    948
  2. ABC
    Replies:
    2
    Views:
    490
    =?Utf-8?B?U2FudGhpIE1hYWRoYXZlbg==?=
    Nov 23, 2005
  3. Jack
    Replies:
    3
    Views:
    666
    Tad J McClellan
    Dec 22, 2008
  4. Replies:
    3
    Views:
    416
  5. Replies:
    1
    Views:
    327
    Thomas 'PointedEars' Lahn
    Mar 19, 2008
Loading...

Share This Page