473,624 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Back Button POST Issue

Is there any way of disabling the repost of information when a user
hits the back button?

Is the only way to do this to actually use some sort of redirect on the
page receiving the initial post (though this won't stop them hitting
back twice and possibly reposting will it?)

Thanks,

Rick

Jan 27 '06 #1
4 3029
Jon
There isn't a true way too that I know. You could always disable the back
button with JS, but that's usually really annoying for users. I usually
write code against the condition. What I'll do is come up with the scenario
on every page that posts info (in particular inserting of records to a DB)
and ask 'what if the user clicks refresh or back'. Think about the queries,
and write some validation that ensures if they do happen to hit back, AND
they ignore the warning that a browser will throw, it won't matter anyways.
Sometimes it's difficult to write, but usually it's not a big deal.

If there is a way to disable POST data on a refresh, I'd love to know how
though :)

"thehuby" <th*****@gmail. com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.com...
Is there any way of disabling the repost of information when a user
hits the back button?

Is the only way to do this to actually use some sort of redirect on the
page receiving the initial post (though this won't stop them hitting
back twice and possibly reposting will it?)

Thanks,

Rick

Jan 27 '06 #2

thehuby wrote:
Is there any way of disabling the repost of information when a user
hits the back button?

Is the only way to do this to actually use some sort of redirect on the
page receiving the initial post (though this won't stop them hitting
back twice and possibly reposting will it?)


That's the way to do it. A browser will only put actual pages into the
history. A POST that doesn't not produce a page, but instead, redirects
to a GET for presentation will not cause the repost warning. And if the
new URL matches exactly that of the page containing the form, the
browser (IE at least), will treat it as though the user has not left
the page at all.

Jan 27 '06 #3
d
"Chung Leong" <ch***********@ hotmail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .

thehuby wrote:
Is there any way of disabling the repost of information when a user
hits the back button?

Is the only way to do this to actually use some sort of redirect on the
page receiving the initial post (though this won't stop them hitting
back twice and possibly reposting will it?)


That's the way to do it. A browser will only put actual pages into the
history. A POST that doesn't not produce a page, but instead, redirects
to a GET for presentation will not cause the repost warning. And if the
new URL matches exactly that of the page containing the form, the
browser (IE at least), will treat it as though the user has not left
the page at all.


Exactly. I use this technique all the time, and it works fine on every
browser I've tested it on.
Jan 27 '06 #4
Jon
Awesome - thanks for the algorithm guys - this will save me a bit of time
with validation :)

"d" <d@example.co m> wrote in message
news:Q7******** *********@text. news.blueyonder .co.uk...
"Chung Leong" <ch***********@ hotmail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. .

thehuby wrote:
Is there any way of disabling the repost of information when a user
hits the back button?

Is the only way to do this to actually use some sort of redirect on the
page receiving the initial post (though this won't stop them hitting
back twice and possibly reposting will it?)


That's the way to do it. A browser will only put actual pages into the
history. A POST that doesn't not produce a page, but instead, redirects
to a GET for presentation will not cause the repost warning. And if the
new URL matches exactly that of the page containing the form, the
browser (IE at least), will treat it as though the user has not left
the page at all.


Exactly. I use this technique all the time, and it works fine on every
browser I've tested it on.

Jan 27 '06 #5

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

Similar topics

2
3840
by: Frawls | last post by:
Hi Can any one give me some help with this problem please? Here is the scenario: A user submits page 1 which is a web form.
8
6128
by: Shimon Sim | last post by:
Hi, Every time I write ASP.NET application I have the same problem - Back button on the browser is my enemy. I have to tell client avoid using "Back" button and if you use it make sure to refresh the page to latest information. I decided to pay information to application on the web and I see that some sites don't have those issues. Like I used some forum site that uses PERL (files with ext. pl) and Back button from browser gets new...
29
3986
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. The submit button posts the page back to the server. The button code detects an entry error and sends the page back to the user. This all works. However, if the user presses the Back button at this point, we go back and all the form values are...
4
8153
by: jwlum | last post by:
I have the following problem under Internet Explorer only: 1. User fills out form data (myform.php) and clicks a button that fires myFunction() 2. myFunction() spawns a "hello, world" popup page via window.open 3. myFunction() submits the main page's form via document.form.submit() 5. User closes popup window and clicks browser's Back button to return to form entry page 6. All the form data that the user had filled out is now blank...
1
2191
by: nileshsoni21 | last post by:
I have come across a strange behaviour in ASP or rather it could be a HTML or Browser Issue. The browser here is IE. The requirement is to re-load the page whenever user click back button of the browser. I thought the solution is simple enough: Just set the page to expired, maintain no cache and Yo! when user clicks back button browser by default should load fresh copy from server.
5
2995
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 page to prevent user to navigate back but its not very effective. The server side scripting is done using ASP. you may ask that why at first place I want to disable the browser back
23
14499
by: Bjorn | last post by:
Hi. Every time i post data in a form the contents are being checked for validity. When i click the back-button, all data is gone and i have to retype it. It's obvious that only a few or none of the visitors will retype it all so i'm asking: "how to preserve POST-data when clicking the back-button?" i've already tried to print post data as a value in a HTML tag but
4
1256
by: Mike Scholl | last post by:
I have written my first bit of php/sql code and set up a website with a small database. I use a html form and submit button to add/edit etc data. If you are editing data, after you have updated the database, if the user presses the back button repeatedly they scroll back through the previous screens which show the data BEFORE the update. I note on some site you get a "this page has expired" message if you try to
5
4487
by: voidinutah | last post by:
Hello, I'm new to .NET and was trying to find a solution for having a button control do a post back then execute a javascript function. When the button is clicked a post back occurs to save the user data, after that a javascript function is called to load a new video. If it wasn't for the video, then I would have used panel controls to hide/ show the content. We are using swfobject to load a series of videos on the same page, and...
0
8234
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8172
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7158
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5563
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4174
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.