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. Advertising

  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. 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. Steve C. Orr [MVP, MCSD]

    Fresh Starter

    Steve C. Orr [MVP, MCSD], Apr 2, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    412
    Abul Hasan
    Apr 3, 2004
  2. peshrad
    Replies:
    1
    Views:
    396
    Peter Blum
    Apr 9, 2004
  3. Replies:
    1
    Views:
    448
  4. rosco
    Replies:
    21
    Views:
    938
    Mabden
    Jun 2, 2004
  5. David Logan
    Replies:
    4
    Views:
    142
    Steven Burn
    May 14, 2004
Loading...

Share This Page