Help needed on navigate back 1 or 2 pages script.

Discussion in 'Javascript' started by Assimalyst, Oct 13, 2005.

  1. Assimalyst

    Assimalyst Guest

    Hi,

    I have a situation where users enter data, then on completion are
    directed to successful.aspx. On this page i essentially want two links,
    one to go to homepage, the other to link back one or two pages add
    another similar set of data.

    This successful.aspx webpage is shared by a number of webforms, but
    some data entry procedures use one webform only, some require two
    webforms. In these instance i want to navigate back to the first
    webform.

    I think the code i need is along the lines of (yes you spotted it, I'm
    a newbie!!):

    function BackClick()
    {
    if(previous webform = wf1.aspx or wf2.aspx)
    {
    history.back(2)
    }
    else
    {
    history.back(1)
    }
    }

    But being a newbie i'm not sure of the syntax required to properly
    invoke the if statement. Could anyone enlighten me? Or indeed offer any
    better solutions.

    Thanks.
     
    Assimalyst, Oct 13, 2005
    #1
    1. Advertising

  2. Assimalyst

    nikki Guest

    Assimalyst wrote:
    >
    > I have a situation where users enter data, then on completion are
    > directed to successful.aspx. On this page i essentially want two links,
    > one to go to homepage, the other to link back one or two pages add
    > another similar set of data.
    >
    > This successful.aspx webpage is shared by a number of webforms, but
    > some data entry procedures use one webform only, some require two
    > webforms. In these instance i want to navigate back to the first
    > webform.
    >


    You're using ASP.NET.
    Don't use javascript for this.
    Save something in ViewState that indicates which web form they used,
    then check that later and dynamically set Hyperlink URL based on it.

    Way easier than trying to save what they did in cookies and determine
    what to do based on it, and all that jazz, which is what you would
    basically need to do with just client-side JS.
     
    nikki, Oct 13, 2005
    #2
    1. Advertising

  3. Assimalyst

    Assimalyst Guest

    Thanks nikki. problem solved.
     
    Assimalyst, Oct 13, 2005
    #3
    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. Magnus Blomberg

    Navigate Back with code

    Magnus Blomberg, Apr 11, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    600
    Magnus Blomberg
    Apr 12, 2005
  2. david wolf

    navigate back in eclipse

    david wolf, Jun 27, 2006, in forum: Java
    Replies:
    6
    Views:
    787
    Hendrik Maryns
    Jun 28, 2006
  3. =?Utf-8?B?UmljaGFyZA==?=

    Differences/best way to navigate thru pages

    =?Utf-8?B?UmljaGFyZA==?=, Jun 27, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    464
    =?Utf-8?B?UmljaGFyZA==?=
    Jun 28, 2007
  4. Joe
    Replies:
    2
    Views:
    223
  5. Justin
    Replies:
    1
    Views:
    258
    Steve van Dongen
    Jul 15, 2004
Loading...

Share This Page