Export (0) Print
Expand All

OnError

Silverlight

Establishes a handler for the event that occurs when the Silverlight plug-in generates a run-time or parse-time error.

<object ...>
  <param name="onerror" value="scriptHandlerName" />
...
</object>

sender

object

The Silverlight plug-in that invoked the event.

errorEventArgs

object

The error and its source location. For more information, see ErrorEventArgs.

None. This event is an event on the Silverlight plug-in as it participates in the hosting browser's DOM, and is therefore out of the scope of the managed API for Silverlight.

The event handled by OnError lets you specify a user-defined JavaScript error-handling function that is invoked when an error is generated in the Silverlight run-time components. The default value is null. If you are using the JavaScript helper file, Silverlight.js, and you do not set OnError to an error-handling function, the default error-handling function, default_error_handler, is used. This handler is defined in Silverlight.js.

The syntax shown is the object param syntax in HTML, which is what is required to set the value. You can also get the value with the following script: value = silverlightObject.onError; . However, this only references the name of the handler and is seldom useful.

Community Additions

ADD
Show:
© 2014 Microsoft