directly typing url in address bar

  • Thread starter Thread starter vips
  • Start date Start date
V

vips

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 said:
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
 
Hello vips,

A somewhat reliable way is to check for Request.UrlReferrer. Some servers
and firewalls strip this out, so be aware of that.
 
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
 
Back
Top