Skip to main content
Home Forums Silverlight Programming Programming with JavaScript RC0 System.ExecutionEngineException
2 replies. Latest Post by Mike4268 on September 29, 2008.
(0)
Mike4268
Member
24 points
29 Posts
09-29-2008 11:13 AM |
I have an object in my silverlight application that I press the delete key on. This calls a javascript function: HtmlPage.Window.Invoke("DeleteAnnotationsById", ids)) The first thing the javascript function does is to call confirm("Are you sure you want to delete this annotation?"); A System.ExecutionEngineException is then thrown and IE7 crashes. This worked in beta2. Any ideas? :)
Gondor
157 points
31 Posts
09-29-2008 1:26 PM |
Maybe this?
From the 'Breaking Changes' document.
KeyDown Sent Synchronously
Who Is Affected: If you previously have been doing operations in the KeyDown event that could cause reentrancy into the Silverlight control, such as calling into the HtmlPage.Window.Alert function, this will no longer be supported.
We switched over our keyboard handling for character input to use the concept of the WM_CHAR windows message. This is used for TextBox/PasswordBox text entry to enable scenarios such as entering AltGr keystrokes. In order for us to do this, the KeyDown event had to be sent synchronously for managed code.
09-29-2008 2:18 PM |
I found another forum post about a similar problem and got it to work like this: this.Dispatcher.BeginInvoke(new AsyncDelete(deleteFunction), new object[]{ids}); public delegate void AsyncDelete(object obj); public void deleteFunction(object obj) { HtmlPage.Window.Invoke("DeleteAnnotationsById", (string)obj); } http://silverlight.net/forums/p/22311/78612.aspx