Solved

Disable browser refresh button

Posted on 2004-04-22
7
1,485 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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now