Silverlight: How to disable the browser’s refresh button?

I am developing a Silverlight application (i.e. no HTML content at all), and one of the biggest complaints is that if the user accidentally clicks F5, the application will restart.

So is there any way to disable the “refresh” button in the browser? Or at least handle F5?

Here are a few options

http://forums .silverlight.net/forums/p/105879/243232.aspx

From the link:

One option is to hook into the window< br> object’onbeforeunload’ event and
prompt the user to confirm the
refresh/exit intent. Here is a
simple example that could be defined
in your HTML markup or even emitted
from the SL app (if it has DOM
access):

I am developing a Silverlight Application (i.e. no HTML content at all), one of the biggest complaints is that if the user accidentally clicks F5, the application will restart.

So is there any way to disable it in the browser” Refresh button? Or at least handle F5?

There are several options here

http://forums.silverlight.net/forums/p/105879/243232 .aspx

From the link:

One option is to hook into the window
object’onbeforeunload’ event and
prompt the user to confirm the
refresh/exit intent. Here is a
simple example that could be defined
in your HTML markup or even emitted
from the SL app (if it has DOM
access):

Leave a Comment

Your email address will not be published.