Professional Web Applications Themes

Get referrer URL - ASP.NET

I'm having problems getting the referrer URL in a VB.NET ASP.NET page. A simple piece of code like this: if not Request.URLReferrer is nothing then _REFUrl = Request.URLReferrer.Host.ToString end if It is not working... Request.URLReferrer always returns nothing. The If...Then is to avoid a runtime error if you call the page directly, in that case there is no referrer and its ok for it to be blank.... but even when I link to the page from another page the referrer is blank.. it only gets a value when the page is posted back! any idea? a bug? or what am ...

  1. #1

    Default Get referrer URL

    I'm having problems getting the referrer URL in a VB.NET ASP.NET page.

    A simple piece of code like this:

    if not Request.URLReferrer is nothing then
    _REFUrl = Request.URLReferrer.Host.ToString
    end if

    It is not working... Request.URLReferrer always returns nothing. The If...Then is to avoid a runtime error if you call the page directly, in that case there is no referrer and its ok for it to be blank....
    but even when I link to the page from another page the referrer is blank.. it only gets a value when the page is posted back!

    any idea? a bug? or what am I doing wrong?

    Harley Guest

  2. #2

    Default Re: Get referrer URL

    still not working... the first call to the page (using a link of course)
    gets en empty referrer...
    any idea why?

    "Michal A. Valasek" <newsaltaircom.net> wrote in message
    news:%23juKM7qUDHA.964TK2MSFTNGP09.phx.gbl...
    > Hello,
    >
    > | I'm having problems getting the referrer URL in a VB.NET ASP.NET page.
    > ...
    > | It is not working... Request.URLReferrer always returns nothing.
    >
    > for me, its working fine. But not every client gives the referer
    correctly,
    > also some ad-removing programs and proxies are deleting it.
    >
    > Try to check value of Request.ServerVariables("HTTP_REFERER"). If it's
    > empty, then no referer value has been sent by client. The URLReferer
    > property takes the value from this HTTP header.
    >
    > --
    > Michal A. Valasek, Altair Communications, [url]http://www.altaircom.net[/url]
    > Please do not reply to this e-mail, for contact see [url]http://www.rider.cz[/url]
    >
    >

    Harley Guest

Similar Threads

  1. About referrer information
    By YNWA in forum Macromedia Flash Player
    Replies: 0
    Last Post: October 20th, 01:56 PM
  2. Retrun to referrer
    By Dax Arroway in forum Macromedia ColdFusion
    Replies: 2
    Last Post: June 2nd, 09:41 AM
  3. The referrer code?...
    By Hawker920 in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: May 17th, 11:37 AM
  4. referrer id
    By M. Evrim Demir in forum ASP
    Replies: 5
    Last Post: July 19th, 06:35 PM
  5. Need webpage only from HTTP-REFERRER
    By Joey Martin in forum ASP
    Replies: 1
    Last Post: July 8th, 08:58 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139