By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,817 Members | 2,152 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,817 IT Pros & Developers. It's quick & easy.

Help needed on navigate back 1 or 2 pages script.

P: n/a
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.

Oct 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

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.

Oct 13 '05 #2

P: n/a
Thanks nikki. problem solved.

Oct 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.