Silverlight中的JS异常处理

by Allan 13. October 2008 20:01
一般当Silverlight运行时发生的一些异常,在一般情况下,都会由Silverlight嵌入页面时的JS给捕获到,所以有时候在看Silverlight的时候,会在左下角看见JS错误的提示框或是一些Alert,常见的就是ImageError,一般由图片路径不对图片不存在引起,为了避免运行时发生这种影响体验的情况,最好的办法还是在C#代码中, 对一些异常的事件进行捕捉,如图片载入失败异常,可以对图片加ImageFailed事件侦听进行捕捉,这样就不会发送到页面的javascript端上去了.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Silverlight

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

TextBox

Tag cloud

    RecentPosts