473,387 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Page redirection history

Hi,

If I navigate from Page1 to Page2 then to Page3, using the
response.redirect.

When the user press the Back button, I what then to go to Page 1 and start
again, not Page2. I dont want the to navigate to Page2 using the Back and
Forward buttons.

How do I do this.

Tim
Nov 18 '05 #1
4 3107
You have to do it manually - save the redirection history in session objects
so when you go to some page check if the last page that is visited is the
page that must be visited before this. if not redirect to the first page

example:

Visit Page1 (add page1 to the session, you can do it with the page name )->
To to Page 2 ( in page load check if previous page is Page 1. if not go to
page1 )
->Go to Page3 ( the same as in page2 checking )

for collecting the pages you can have a hashtable ( the index of visited
pages will the key - 1,2,3 ..., array - the index of visited pages will be
the index )

Hope this helps

Regards
Martin

"Tim Marsden" <TM@UK.COM> wrote in message
news:#K**************@TK2MSFTNGP11.phx.gbl...
Hi,

If I navigate from Page1 to Page2 then to Page3, using the
response.redirect.

When the user press the Back button, I what then to go to Page 1 and start
again, not Page2. I dont want the to navigate to Page2 using the Back and
Forward buttons.

How do I do this.

Tim

Nov 18 '05 #2
Use Server.Transfer to navigate to Page2 and Response.Redirect to navigate to Page3. Server.Transfer will not create an entry in a browser's history.

http://msdn.microsoft.com/library/de...anotherpage.as

Svetlan
Nov 18 '05 #3
"Tim Marsden" <TM@UK.COM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Hi,

If I navigate from Page1 to Page2 then to Page3, using the
response.redirect.

When the user press the Back button, I what then to go to Page 1 and start
again, not Page2. I dont want the to navigate to Page2 using the Back and
Forward buttons.


You would have to tell the user's web browser not to allow the "back"
button. You'd probably also want it not to allow the user to manually enter
the URL for page 2.

Otherwise, the user will be able to do whatever the user wants, which may
very well be what the users expect.
--
John Saunders
johnwsaundersiii at hotmail
Nov 18 '05 #4
Hi Tim,

As for how to prevent the browser navigate a certain page in the history
list when we hit back button, here are some of my suggestions:

Generally, when we navigate to a page in the browser, the url will be loged
into the Browser's history lists. And when we hit "back" button, the
browser will go back according to the history url array. One way to avoid
the current page's url be added into the history list is using the
"window.location.replace(url)" javascript function, this method will
redirect the browser location to another url and the important thing is
that it won't add a new item in the history list but replace the previous
page's history url item. So as for your situation, you can do the folliwing
steps to implement your task:
1.use any means to redirect from page1.aspx to page2.aspx

2. in page2.aspx , we use clientside script to redirect rather than use
serverside code, for example , use the following function
<script language="javascript" >
function NoHistoryRedirect(url)
{
window.location.replace(url);
}
</script>

in a button's client click event , call "NoHistoryRedirect('page3.aspx');"

this will change the current page's location to the speicified url and
replace the url in the browser's history url list. So that when we hit
"back" button, it won't stop at page2.
Please have a try to see whether it helps. thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Jerry McEwen | last post by:
I'm working on a web site for a domestic violence group and these groups always have an "escape" button, which is simply a link to another site. Whether I open this link in the same window, a new...
5
by: Daniel | last post by:
how to detect who redirects traffic to a aspx page? is this info passed along in request object or can sites anonymously redirect traffic to other sites?
0
by: Goober at christianDOTnet | last post by:
I'm wanting to fix the following on a web page without really re-inventing anything. What I have is a vb web page with a radiobuttonlist where I can pick Current or History year. Underneath...
1
by: craigkenisston | last post by:
Hi, I recently read a lot about a topic called page hijacking. It seems that you can steal page rank from search engines while doing a redirect. I reminded I had a code in some pages, where...
10
Ajm113
by: Ajm113 | last post by:
Making a History Page for BIG Sites Intro: Ok, let's say after a while your website has grown massive. We're talking search engine, forum and video hosting -- you've got a LOT of content. And you...
12
by: jim.richardson | last post by:
Hi all, I'd like a page to be excluded from the back button history, that is, when a user hits their browser's back button, it never backs into this particular page. Can anybody please tell...
6
by: =?Utf-8?B?YzY3NjIyOA==?= | last post by:
Hi all, We have two sites hosted on different servers and we have many pages on domain A which has many links(asp programs) to domain B. My question is if domain B server is in trouble, what is...
13
by: staeri | last post by:
I use javascript:history.go(-1) to return to the previous page. I've now found out that when returning to the previous page all selections that the user made in dropdownlists are lost. How can...
4
by: | last post by:
Hello, I have a couple of web apps built using C# in VS2008 (.NET 2.0) and in some circumstances they exhibit an anoying feature. If I start in appA and follow a link to appB I can still see the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.