Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug Proper utilization of Application_Exit
1 replies. Latest Post by tonypujals on May 6, 2008.
(0)
jpsscott
Member
51 points
84 Posts
05-06-2008 11:01 AM |
Hi,
I have a database back-end in a Silverlight app. When the app exists I want to call to the server to update my "last record" the user is editing. So far I've noticed two problems here:
1) Application_Exit event seems to be firing twice
2) Doing an async call using HttpWebRequest doesn't work because the sockets/UI thread/whatever gets closed down before my call to the server completes.
So I guess the big question is how can I save information to our back-end database from the application_exit event? I also noticed that the documentation says "this shouldn't contain long-running code". What's considered long running code? Obviously we wouldn't want something looping endlessly or taking an extreme amount of time, but I do have data and settings I need to save back to server.
I want to be able to save that information in all cases (user closes browser, user refreshes view etc.)
Thanks for any insight!
James
tonypujals
10 points
5 Posts
05-06-2008 5:17 PM |
I'm interested the answer to this as well. I'm trying to have my wcf proxy unsubscribe from a notification service right before closing it, but raises an exception from System.ServiceModel if I attempt to do it from Application_Exit.