directly typing url in address bar

Discussion in 'ASP .Net' started by vips, Mar 31, 2005.

  1. vips

    vips Guest

    how can we identify whether the web page is opened by typing the link in the
    address bar or it opened by clicking it from one of the previous pages ??

    Is there any way to find this out .....I want the page to open only if it
    come from the previous page and not by directly typing the url of my webpage
    !!

    vips
     
    vips, Mar 31, 2005
    #1
    1. Advertising

  2. vips wrote:
    > how can we identify whether the web page is opened by typing the link in the
    > address bar or it opened by clicking it from one of the previous pages ??
    >
    > Is there any way to find this out .....I want the page to open only if it
    > come from the previous page and not by directly typing the url of my webpage
    > !!
    >
    > vips
    >
    >


    Hi,

    Basically i'm poking in the dark here, but i guess what you want here is
    to use Request.Headers["Referrer"] (note: since i have not done this
    before you would have to figure out the exact implementation details
    your self). If the Request.Headers["Referrer"] is empty (possibly null)
    then the page has been access directly, else the page has been referred
    to from another website (you will get the URL value of the referring page)

    Hope this helps,

    Nick Goloborodko
    http://nickgoloborodko.com
     
    Nick Goloborodko, Mar 31, 2005
    #2
    1. Advertising

  3. vips

    Prodip Saha Guest

    How about -Context.Handler.ToString()

    Compare this with the current page like ASP.WebForm_aspx or
    _ASP.WebForm_aspx.

    Thanks,
    Prodip
    www.aspnet4you.com

    "vips" <> wrote in message
    news:...
    > how can we identify whether the web page is opened by typing the link in

    the
    > address bar or it opened by clicking it from one of the previous pages ??
    >
    > Is there any way to find this out .....I want the page to open only if it
    > come from the previous page and not by directly typing the url of my

    webpage
    > !!
    >
    > vips
    >
    >
     
    Prodip Saha, Mar 31, 2005
    #3
  4. vips

    Matt Berther Guest

    Hello vips,

    A somewhat reliable way is to check for Request.UrlReferrer. Some servers
    and firewalls strip this out, so be aware of that.

    --
    Matt Berther
    http://www.mattberther.com

    > how can we identify whether the web page is opened by typing the link
    > in the address bar or it opened by clicking it from one of the
    > previous pages ??
    >
    > Is there any way to find this out .....I want the page to open only if
    > it come from the previous page and not by directly typing the url of
    > my webpage !!
    >
    > vips
    >
     
    Matt Berther, Mar 31, 2005
    #4
  5. vips

    darrel Guest

    > If the Request.Headers["Referrer"] is empty (possibly null)
    > then the page has been access directly, else the page has been referred
    > to from another website (you will get the URL value of the referring page)


    This can also be null if the end-user is using some software on their
    machine that blocks this information...such as NAV, I believe.

    There probably isn't a sure-fire way to do this.

    -Darrel
     
    darrel, Mar 31, 2005
    #5
    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. Matt
    Replies:
    0
    Views:
    3,572
  2. John Hann
    Replies:
    0
    Views:
    6,119
    John Hann
    Aug 21, 2004
  3. Matt
    Replies:
    9
    Views:
    71,043
  4. jonesy
    Replies:
    0
    Views:
    565
    jonesy
    Oct 26, 2006
  5. Matt
    Replies:
    9
    Views:
    581
    kaeli
    Aug 23, 2004
Loading...

Share This Page