Possible Duplicates:
Disable browser's back button
How do I disable the F5 refresh on the browser?
Hi,
I created an application in C# that will download data from the internet (and this is done one time only) and put it in a webbrowser and this data should be static. I want to know if there is a way to disable the F5 key from doing a refresh?
I tried injecting javascript to disable F5 but it will still refresh the webbrowser.
You can only do it by disabling F5. I googled "Disable F5 Refresh" and got quite enough searches to figure it out quickly. If you disable my F5 , I'll try CTRL+W or ALT+F4 next.
off("keydown", disableF5); On a side note: This only disables the f5 button on the keyboard.
Click the Start button, type “internet options” and select Internet Options in the search results. In the Internet Properties window, click “Custom tab -> Custom level,” then in the Security Settings window, scroll down until you find “Allow META REFRESH.” Disable this option and click OK.
we can easily disable f5 button using javascript with example. we will disable f5 key using keydown event of jquery. as we know f5 key code is a 116, so basically if user will press 116 event. keyCode then we will simply preventDefault with return false.
You cannot disable F5 (or other browser shortcut keys) via JavaScript.
Setting the WebBrowserShortcutsEnabled
property of the WebBrowser
control to false
should accomplish what you're trying to do.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With