473,396 Members | 1,773 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,396 software developers and data experts.

Back Button

In some pages of my Web Application I need to "disable" the back button, and
for that I have this (that is not working), that is the solution found it in
the Internet:

<script language=javascript>
location.replace('myPage.aspx');
</script>

What do I have to do more?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
Nov 18 '05 #1
5 1530
There is no way to do that, or to have a 100% full proof way of preventing
the user from going back.

"ruca" <ru***@iol.pt> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
In some pages of my Web Application I need to "disable" the back button, and for that I have this (that is not working), that is the solution found it in the Internet:

<script language=javascript>
location.replace('myPage.aspx');
</script>

What do I have to do more?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #2
Why do you need to disable the back button ? I would try to solve the
problem caused by the back button rather than trying to disabling it because
it causes a problem (generally not easy if possible at all and the user
could always cut paste the previous URL and would get the same problem
etc...)
"ruca" <ru***@iol.pt> a écrit dans le message de
news:%2******************@tk2msftngp13.phx.gbl...
In some pages of my Web Application I need to "disable" the back button, and for that I have this (that is not working), that is the solution found it in the Internet:

<script language=javascript>
location.replace('myPage.aspx');
</script>

What do I have to do more?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #3
As another poster mentioned, there is no fool-proof way ... but here is a
technique I employ with a good amount of success:

<body onPageLoad="history.go(1)">

It's the equivelant of hitting the Forward button when a page loads, and
wont hit the server for either the Current or Previous page.

-- Alex Papadimoulis

"ruca" <ru***@iol.pt> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
In some pages of my Web Application I need to "disable" the back button, and for that I have this (that is not working), that is the solution found it in the Internet:

<script language=javascript>
location.replace('myPage.aspx');
</script>

What do I have to do more?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca

Nov 18 '05 #4
Hi Alex,

<script language=javascript>
location.replace('myPage.aspx');
</script>

As I search in internet, many places talk about above method. So far as I
understand this replace the last page in History, and I think that if works
like this it was more useful for me. The problem it's that when I use it
nothing happens. Do you know?

Thanks anyway
Ruca
"Alex Papadimoulis" <al***@papadimoulis.com> escreveu na mensagem
news:10*************@corp.supernews.com...
As another poster mentioned, there is no fool-proof way ... but here is a
technique I employ with a good amount of success:

<body onPageLoad="history.go(1)">

It's the equivelant of hitting the Forward button when a page loads, and
wont hit the server for either the Current or Previous page.

-- Alex Papadimoulis

"ruca" <ru***@iol.pt> wrote in message
news:%2******************@tk2msftngp13.phx.gbl...
In some pages of my Web Application I need to "disable" the back button, and
for that I have this (that is not working), that is the solution found

it in
the Internet:

<script language=javascript>
location.replace('myPage.aspx');
</script>

What do I have to do more?
--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca


Nov 18 '05 #5
Where should I put this code:
----------------------------------
<script language=javascript>
location.replace('myPage.aspx');
</script>


----------------------------------
to simulate the "disable" back button?

--
Programming ASP.NET with VB.NET
Thank's (if you try to help me)
Hope this help you (if I try to help you)
ruca
Nov 18 '05 #6

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

Similar topics

25
by: KK | last post by:
Hi, I am using history.go(-1) for implementing the back button functionality. Its working fine but with this exception. 1. The page which is having back button has some hyperlinks on it. ...
1
by: Peter D. Dunlap | last post by:
Hello, I realize that this may not be the best place to ask this question, through the application is asp.net. I also realize that questions about disabling the back button are generally met...
4
by: Hypo | last post by:
I added a 'Back' button to my page, and wrote 'OnClick' code something like this: Response.Write("<script>history.go(-" + iDepthIndex.ToString() + ");</script>"); But, it dosnt work! Effect...
8
by: Galina | last post by:
Hello I have 6 dependent list boxes on my ASP page:  Faculty;  Lecturer;  Course;  Course occurrence;  Group;  Week commencing date. When faculty is selected, lists of lecturers and...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
29
by: Tom wilson | last post by:
I can't believe this is such an impossibility... I have an asp.net page. It accepts data through on form fields and includes a submit button. The page loads up and you fill out some stuff. ...
6
by: tshad | last post by:
I am trying to set up a Javascript popup box that has a way of sending back a message to asp.net on how to process some data. At the moment I am just doing: ...
5
by: Tom wilson | last post by:
I'm developing an application that is a benefits enrolment website. The benefits can be of any type in any order as stored in a SQL server. On each page is a Back and Next button. At a certain...
7
by: Sridhar | last post by:
Hi, I have a question regarding the Page_Load method and Back Button of Internet explorer. I have created a webform. In that webform I have several Text Boxes. Also I have two buttons. When I...
5
by: ns21 | last post by:
How can the browser back button be disabled If the form is submitting information to other pages or submitting to itself or using redirections. I tried the tweaks like history.forward(1) in each...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.