How detect if page is requested from other page or a fresh request

Discussion in 'ASP .Net' started by Ankur, Jul 1, 2009.

  1. Ankur

    Ankur Guest

    Hello,
    In Page_Init event, I need to determine if page is requested as a result of
    redirection (i.e. using request.redirect() method) or by directly typing in
    the address bar.
    Lets assume, to open "mysite.com" site, you can either directly type the
    address in address bar or click on <a href="www.mysite.com">mysite</a> link
    on some page. Now in mysite's index page, I wish to detect if user typed the
    address in address bar or clicked on link contained in some page.
    I tried using URLRefferer couldn't get it work for me as I am new to ASP.Net.
    Please assist. All comments are welcomed.
    Thanks for your time.
     
    Ankur, Jul 1, 2009
    #1
    1. Advertisements

  2. Ankur

    Daniel Ulfe Guest

    Hi,

    Check this property: Request.UrlReferrer

    Daniel.

    Ankur wrote:
    > Hello,
    > In Page_Init event, I need to determine if page is requested as a result of
    > redirection (i.e. using request.redirect() method) or by directly typing in
    > the address bar.
    > Lets assume, to open "mysite.com" site, you can either directly type the
    > address in address bar or click on <a href="www.mysite.com">mysite</a> link
    > on some page. Now in mysite's index page, I wish to detect if user typed the
    > address in address bar or clicked on link contained in some page.
    > I tried using URLRefferer couldn't get it work for me as I am new to ASP.Net.
    > Please assist. All comments are welcomed.
    > Thanks for your time.
     
    Daniel Ulfe, Jul 1, 2009
    #2
    1. Advertisements

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. Brian Birtle
    Replies:
    2
    Views:
    2,547
    John Saunders
    Oct 16, 2003
  2. Patrick Delifer
    Replies:
    0
    Views:
    3,541
    Patrick Delifer
    May 3, 2004
  3. Natty Gur
    Replies:
    0
    Views:
    2,766
    Natty Gur
    Jun 6, 2004
  4. =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Replies:
    0
    Views:
    2,593
    =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Jun 7, 2004
  5. savvy
    Replies:
    8
    Views:
    23,598
    kamer
    Nov 18, 2006
  6. VK

    Strange form request - Ideas or input requested

    VK, Feb 22, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    228
    MasterGaurav
    Feb 25, 2005
  7. David Logan
    Replies:
    4
    Views:
    247
    Steven Burn
    May 14, 2004
  8. Îικόλαος ΚοÏÏας

    Wrong website loaded when other requested

    Îικόλαος ΚοÏÏας, Jun 12, 2013, in forum: Python
    Replies:
    50
    Views:
    658
    Antoon Pardon
    Jun 16, 2013
Loading...