Click here to Skip to main content
15,904,288 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In my application i need to prevent user clicking F5 button and reload image in browser because by clicking F5 button and Reload image twice it is taking me to run time error.How can i prevent it

What I have tried:

i tried javascript codes but stiil i am getting the same
Posted
Updated 28-Jan-18 22:54pm
Comments
F-ES Sitecore 29-Jan-18 4:22am    
Once you've stopped them clicking f5 you'll need to stop them selecting refresh from the context menu, or clicking the refresh icon in the address bar. Then a new browser comes out where f6 is refresh and not f5, what do you do then?

You're thinking about this from the wrong angle, rather than trying to stop the user doing basic browser functions (which you can't) you should fix your code so it doesn't error when the user refreshes.

1 solution

Quote:
How can I prevent pressing F5 button and reload image click in browser using ASP .NET C#

Short answer: you don't. You don't have control of client side of browser.
Quote:
In my application i need to prevent user clicking F5 button and reload image in browser because by clicking F5 button and Reload image twice it is taking me to run time error.How can i prevent it

Debug your code
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900