Go back where I came from

Discussion in 'ASP .Net' started by Peter, Nov 11, 2005.

  1. Peter

    Peter Guest

    When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

    Thanks

    Peter
     
    Peter, Nov 11, 2005
    #1
    1. Advertising

  2. To determine if there is history exists ,Checkout Request.UrlReferrer

    code would be like ,

    if (Request.UrlReferrer == null )
    //add javascript to the close button to navigate to "specific page"
    else
    //add javascript to the close button to do history.go(-1);


    "Peter" wrote:

    > When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?
    >
    > Thanks
    >
    > Peter
    >
     
    =?Utf-8?B?U3JlZWppdGggUmFt?=, Nov 11, 2005
    #2
    1. Advertising

  3. Peter

    clintonG Guest

    What version of ASP.NET are you using?
    The answer Sreejith tried to give is incorrect.


    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL http://metromilwaukee.com/
    URL http://clintongallagher.metromilwaukee.com/


    "Peter" <> wrote in message news:...
    When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

    Thanks

    Peter
     
    clintonG, Nov 11, 2005
    #3
  4. Peter

    Peter Guest

    I am using .NET 1.1
    "clintonG" <> wrote in message news:...
    What version of ASP.NET are you using?
    The answer Sreejith tried to give is incorrect.


    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL http://metromilwaukee.com/
    URL http://clintongallagher.metromilwaukee.com/


    "Peter" <> wrote in message news:...
    When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

    Thanks

    Peter
     
    Peter, Nov 11, 2005
    #4
  5. Peter

    clintonG Guest

    I'm sorry, I see I failed to explain why I thought Sreejith was wrong.
    Do you want to go back only one page or back to the homepage of the website?

    <%= Clinton Gallagher

    "Peter" <> wrote in message news:...
    I am using .NET 1.1
    "clintonG" <> wrote in message news:...
    What version of ASP.NET are you using?
    The answer Sreejith tried to give is incorrect.


    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL http://metromilwaukee.com/
    URL http://clintongallagher.metromilwaukee.com/


    "Peter" <> wrote in message news:...
    When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

    Thanks

    Peter
     
    clintonG, Nov 11, 2005
    #5
  6. Peter

    Peter Guest

    One page.
    "clintonG" <> wrote in message news:...
    I'm sorry, I see I failed to explain why I thought Sreejith was wrong.
    Do you want to go back only one page or back to the homepage of the website?

    <%= Clinton Gallagher

    "Peter" <> wrote in message news:...
    I am using .NET 1.1
    "clintonG" <> wrote in message news:...
    What version of ASP.NET are you using?
    The answer Sreejith tried to give is incorrect.


    <%= Clinton Gallagher
    METROmilwaukee (sm) "A Regional Information Service"
    NET csgallagher AT metromilwaukee.com
    URL http://metromilwaukee.com/
    URL http://clintongallagher.metromilwaukee.com/


    "Peter" <> wrote in message news:...
    When user Clicks on the Close button on the main form I would like to go back where the user came from. If my form is the first page since IE was opened I would like to go to the specific website. Is that possible?

    Thanks

    Peter
     
    Peter, Nov 14, 2005
    #6
  7. Sorry for the interrupting.

    Hi Peter,

    I think the Request.UrlReferer or javascript window.history.go(-1) all
    make sense. However, Request.UrlReferer will contains the original page's
    location (it's a standard http header ..), however, this is not always set
    by the cilent browser. And as for window.history.go(-1) , this script will
    make the clientside browser go back one steps from the browser's history
    list(just like when we hit the "back" button on browser...). The problem
    of history.go(-1) is that when we have performed some post back on the
    form, the postback version of the page will also be added into the history
    list , so go(-1) one steps may not meet the requirements. So if there is
    postback on the page, we may have to record this , (make a post back count
    stored in viewstate...) and so that we can put the count in the history.go(
    -count) as parameter...

    Thanks,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)
    --------------------
    | From: "Peter" <>
    | References: <>
    <>
    <>
    <>
    | Subject: Re: Go back where I came from
    | Date: Sun, 13 Nov 2005 22:43:25 -0600
    | Lines: 151
    | MIME-Version: 1.0
    | Content-Type: multipart/alternative;
    | boundary="----=_NextPart_000_000E_01C5E8A3.A8CEDE10"
    | X-Priority: 3
    | X-MSMail-Priority: Normal
    | X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    | Message-ID: <>
    | Newsgroups: microsoft.public.dotnet.framework.aspnet
    | NNTP-Posting-Host: cpe-69-23-74-9.new.res.rr.com 69.23.74.9
    | Path:
    TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fa
    stwebnet.it!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!t-on
    line.de!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    | Xref: TK2MSFTNGXA02.phx.gbl
    microsoft.public.dotnet.framework.aspnet:357828
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
    |
    | One page.
    | "clintonG" <> wrote in
    message news:...
    | I'm sorry, I see I failed to explain why I thought Sreejith was wrong.
    | Do you want to go back only one page or back to the homepage of the
    website?
    | <%= Clinton Gallagher
    | "Peter" <> wrote in message
    news:...
    | I am using .NET 1.1
    | "clintonG" <> wrote in
    message news:...
    | What version of ASP.NET are you using?
    | The answer Sreejith tried to give is incorrect.
    | <%= Clinton Gallagher
    | METROmilwaukee (sm) "A Regional Information Service"
    | NET csgallagher AT metromilwaukee.com
    | URL http://metromilwaukee.com/
    | URL http://clintongallagher.metromilwaukee.com/
    | "Peter" <> wrote in message
    news:...
    | When user Clicks on the Close button on the main form I would
    like to go back where the user came from. If my form is the first page
    since IE was opened I would like to go to the specific website. Is that
    possible?
    | Thanks
    | Peter
    |
     
    Steven Cheng[MSFT], Nov 14, 2005
    #7
    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. William Newsom
    Replies:
    1
    Views:
    371
    Ed Crowley
    Sep 24, 2003
  2. =?Utf-8?B?SGVua2U=?=

    How to get the url where I came from?

    =?Utf-8?B?SGVua2U=?=, Jun 7, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    394
    Juan T. Llibre
    Jun 7, 2005
  3. Alan Silver
    Replies:
    5
    Views:
    611
  4. Rob R. Ainscough

    who came up with JavaScript language syntax?

    Rob R. Ainscough, Jan 17, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    393
    Kevin Spencer
    Jan 18, 2006
  5. =?Utf-8?B?U2VnYQ==?=

    Where request came from/referrer

    =?Utf-8?B?U2VnYQ==?=, Apr 11, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    743
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Apr 11, 2006
Loading...

Share This Page