Experience10  Creative, Develop, UX, Wireframe, Productivity

Silverlight中的JS异常处理

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

This entry was written by allan, posted on October 13, 2008 at 8:01 pm, filed under Play. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

Timeline

Have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.


Copyright 2010 Experience10.com
Designed by Allan