Solved

Disable browser refresh button

Posted on 2004-04-22
7
1,489 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
  • 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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 125 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

830 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