[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1495
  • Last Modified:

Disable browser refresh button

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
ayha1999
Asked:
ayha1999
  • 3
  • 3
1 Solution
 
ZylochCommented:
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
 
ayha1999Author Commented:
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
 
devicCommented:
>>>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 Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
ayha1999Author Commented:
Hi devic,

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

ayha1999.
0
 
devicCommented:
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
 
ayha1999Author Commented:
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
 
devicCommented:
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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now