?
Solved

Disable browser refresh button

Posted on 2004-04-22
7
Medium Priority
?
1,494 Views
Last Modified: 2007-12-19
Hi,

I want to disable the browser refresh button for some pages. How can i do that if possible?  can anybody help me.

ayha1999.
0
Comment
Question by:ayha1999
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 36

Expert Comment

by:Zyloch
ID: 10892733
Why do you want to disable the refresh button? Can you give us an idea on the reason, because it is impossible to actually disable refresh, and tricks for "disabling" the back button do not work for refresh. There may be other workaround though.

--Zyloch
0
 
LVL 7

Author Comment

by:ayha1999
ID: 10893191
Hi Zyloch,

i have an asp page for adding products.  when user add and click on submit it will be added to db and display in another page. if user refresh the page, the same product will be added again and so on.  i want to prevent to be added again.  the problem there is no items in the product add is unique.

ayha1999.
0
 
LVL 25

Expert Comment

by:devic
ID: 10893654
>>>i have an asp page for adding products.  when user add and click on submit it will be added to db

use <form method=post>

or

your cart.asp will be redirect to another page.

'bla bla bla add to DB....
'End of cart.asp
Response.Redirect "ready.asp"
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 7

Author Comment

by:ayha1999
ID: 10893729
Hi devic,

your solution disabling browser button is not clear. could you pls. explain in details.

ayha1999.
0
 
LVL 25

Expert Comment

by:devic
ID: 10893780
hi ayha1999,

i don't disable any browser button, my suggestion is avoid dublicates in DB if you refresh page like cart.asp?itemId=23&cid=2

so, as i wrote above, in your page where you work with DB, if your are ready, redirect to another page. Or to the same page without QueryString.

so first call was cart.asp?itemId=23&cid=2

'bla bla bla add to DB....

Response.Redirect "cart.asp"

so last page is "cart.asp"  without QueryString.


============================
the first suggestion is adding just method=POST, if user try to refresh, comes message, that will be submited twice

0
 
LVL 7

Author Comment

by:ayha1999
ID: 10893842
Hi devic,

you mean once the products are added, it has to redirect to another page? As i told you in my previous comment, no items in my prdouctadd page is unique.

ayha1999.
0
 
LVL 25

Accepted Solution

by:
devic earned 500 total points
ID: 10893869
yes redirect, and if you have page "cart.asp" without QueryString like "cart.asp?itemId=23&cid=2"
then refresh is doesn't matter
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question