Link to home
Start Free TrialLog in
Avatar of ayha1999
ayha1999

asked on

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.
Avatar of Zyloch
Zyloch
Flag of United States of America image

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
Avatar of ayha1999
ayha1999

ASKER

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.
>>>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"
Hi devic,

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

ayha1999.
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

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.
ASKER CERTIFIED SOLUTION
Avatar of devic
devic
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial