Request.UrlReferrer is always null RRS feed

  • Question

  • User-728782095 posted
    I've recently noticed in my development environment that Request.UrlReferrer is always null.  This wasn't always so, and I have some code that depends on it that now doesn't work.  I haven't noticed this in production and I'm curious to figure out why this is.  Has anyone else seen odd behavior like this?
    Friday, April 20, 2007 11:56 PM


All replies

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 21, 2007 1:21 AM
  • User445179017 posted

    The URL Referrer returns a value only when the user reaches the current page through a link from the previous page. Otherwise, document.referrer returns an empty string. The url referrer also returns an empty string if you have reached to that page from a secure site.


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 21, 2007 5:50 AM
  • User-728782095 posted

    So it would be safe to assume that if I do a Response.Redirect from one page in my site to another, UrlReferrer should have the previous page in it?

    That was always the behavior until not too long ago, then it all of a sudden was always null.  Quite strange.

    Tuesday, April 24, 2007 9:50 AM
  • User955742345 posted

    I've found that UrlReferrer is null if I'm using AJAX to call Response.Redirect.  I.e. a LinkButton in a GridView (on an UpdatePanel) is clicked, then the user is redirected, but the referrer is null.

    If I'm NOT using AJAX, it works as expected, with the previous page in UrlReferrer.

    I'm not sure if you're using AJAX as well, but this is definitely unwanted behavior.

    Tuesday, April 24, 2007 9:57 AM
  • User-728782095 posted

    Yeah, I'm not using AJAX in this instance (though we do use it in other places).

    What I just found totally bizzaro was that it WAS working last week at some point.  Then all of a sudden anywhere I looked in my application, it was set to null.  I'm doing some more digging around to see if I can find the 'cause and a potential fix.  If I find it, I'll post it up.

    Tuesday, April 24, 2007 10:04 AM
  • User-728782095 posted

    I just found this via a Google search:


    I run NAV on my workstation.  I tested from my MacBook and the code executes as it should.  I think I've found the cause of the problem. ;-)

    Tuesday, April 24, 2007 10:12 AM
  • User-137998610 posted

    It is not only because of Norton Internet Security.

    It happen too on symantec client firewall.

    All we need to do is add the website in the trusted zone/permit all state to allow full access.

    I have tried the same and it worked.

    Wednesday, August 6, 2008 1:41 AM