Referring URL\VB

Discussion in 'ASP .Net' started by George, Feb 9, 2004.

  1. George

    George Guest

    VS.NET 2002\Web\VB

    I am trying to get the referring URL for one of my pages using this:

    Request.UrlReferrer.ToString

    Page 1 has a link to Page 2. I click on the link in Page 1, and go to Page
    2. Page 2 is where I am trying to get the referring URL. However, instead of
    getting the URL of Page 1 (the referring page), I get the URL of the Page 2
    (the current page), instead.

    Am I not using that right?

    Thanks,
    George
     
    George, Feb 9, 2004
    #1
    1. Advertising

  2. George

    George Guest

    Also, I might add, that Page 1 (the referrer) is an .htm page, and Page 2 is
    an .aspx page.


    "George" <------@----.---> wrote in message
    news:RbEVb.3261$...
    > VS.NET 2002\Web\VB
    >
    > I am trying to get the referring URL for one of my pages using this:
    >
    > Request.UrlReferrer.ToString
    >
    > Page 1 has a link to Page 2. I click on the link in Page 1, and go to Page
    > 2. Page 2 is where I am trying to get the referring URL. However, instead

    of
    > getting the URL of Page 1 (the referring page), I get the URL of the Page

    2
    > (the current page), instead.
    >
    > Am I not using that right?
    >
    > Thanks,
    > George
    >
    >
    >
    >
     
    George, Feb 9, 2004
    #2
    1. Advertising

  3. George

    gary Vidal Guest

    Do you have any postbacks. You should check the postback before you store
    the Referrer or else the page will refer back to itself since it is posting
    back to itself.

    If you do you can save the referrer the first time the page loads in the
    viewstate of the page as follows:
    If Not IsPostback then
    Viewstate("ReferrerURL") = Request.UrlReferrer.ToString()
    End If

    "George" <------@----.---> wrote in message
    news:RbEVb.3261$...
    > VS.NET 2002\Web\VB
    >
    > I am trying to get the referring URL for one of my pages using this:
    >
    > Request.UrlReferrer.ToString
    >
    > Page 1 has a link to Page 2. I click on the link in Page 1, and go to Page
    > 2. Page 2 is where I am trying to get the referring URL. However, instead

    of
    > getting the URL of Page 1 (the referring page), I get the URL of the Page

    2
    > (the current page), instead.
    >
    > Am I not using that right?
    >
    > Thanks,
    > George
    >
    >
    >
    >
     
    gary Vidal, Feb 9, 2004
    #3
  4. George

    George Guest

    Hey Gary,

    That is exactly what was happening! I now have it working.

    Thanks for your help.
    George

    "gary Vidal" <> wrote in message
    news:...
    > Do you have any postbacks. You should check the postback before you store
    > the Referrer or else the page will refer back to itself since it is

    posting
    > back to itself.
    >
    > If you do you can save the referrer the first time the page loads in the
    > viewstate of the page as follows:
    > If Not IsPostback then
    > Viewstate("ReferrerURL") = Request.UrlReferrer.ToString()
    > End If
    >
    > "George" <------@----.---> wrote in message
    > news:RbEVb.3261$...
    > > VS.NET 2002\Web\VB
    > >
    > > I am trying to get the referring URL for one of my pages using this:
    > >
    > > Request.UrlReferrer.ToString
    > >
    > > Page 1 has a link to Page 2. I click on the link in Page 1, and go to

    Page
    > > 2. Page 2 is where I am trying to get the referring URL. However,

    instead
    > of
    > > getting the URL of Page 1 (the referring page), I get the URL of the

    Page
    > 2
    > > (the current page), instead.
    > >
    > > Am I not using that right?
    > >
    > > Thanks,
    > > George
    > >
    > >
    > >
    > >

    >
    >
     
    George, Feb 9, 2004
    #4
    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. BernieH

    Referring URL

    BernieH, Aug 9, 2005, in forum: HTML
    Replies:
    1
    Views:
    569
    Safalra
    Aug 9, 2005
  2. tiewknvc9

    getting a referring url?

    tiewknvc9, Sep 11, 2006, in forum: Java
    Replies:
    2
    Views:
    7,923
    Rogan Dawes
    Sep 11, 2006
  3. paladin

    Missing Referring URL in log files

    paladin, Jan 10, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    569
    paladin
    Jan 11, 2007
  4. slamar
    Replies:
    0
    Views:
    899
    slamar
    Aug 17, 2011
  5. Chumley the Walrus

    Checking to see if a referring url/link matches

    Chumley the Walrus, Jul 1, 2004, in forum: ASP General
    Replies:
    4
    Views:
    157
    Steven Burn
    Jul 1, 2004
Loading...

Share This Page