Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Help needed on navigate back 1 or 2 pages script.

Reply
Thread Tools

Help needed on navigate back 1 or 2 pages script.

 
 
Assimalyst
Guest
Posts: n/a
 
      10-13-2005
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.

 
Reply With Quote
 
 
 
 
nikki
Guest
Posts: n/a
 
      10-13-2005

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.

 
Reply With Quote
 
 
 
 
Assimalyst
Guest
Posts: n/a
 
      10-13-2005
Thanks nikki. problem solved.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error on page, but when you navigate back and resubmit, no Error Joe ASP General 2 12-02-2008 08:14 PM
Differences/best way to navigate thru pages =?Utf-8?B?UmljaGFyZA==?= ASP .Net 2 06-28-2007 04:26 PM
navigate back in eclipse david wolf Java 6 06-28-2006 12:13 PM
Navigate Back with code Magnus Blomberg ASP .Net 2 04-12-2005 08:00 AM
top.frames[0].history.back() causing wrong frame to navigate backwards Justin Javascript 1 07-15-2004 09:32 AM



Advertisments