开发者

Can I pass a JSON object from Silverlight to javascript

开发者 https://www.devze.com 2022-12-20 19:15 出处:网络
I know I can call javascript and pass string values from Silverlight, but can I pass a JSON object or does it开发者_Go百科 have to be serialized?If you make the object have [ScriptableType] and pass i

I know I can call javascript and pass string values from Silverlight, but can I pass a JSON object or does it开发者_Go百科 have to be serialized?


If you make the object have [ScriptableType] and pass it in your arguments, you can achieve what you're trying to do without encoding the object to JSON and decoding on the JS side:

See the heading Return Objects From Silverlight Method Calls To JavaScript at http://pietschsoft.com/post/2008/06/19/Silverlight-and-JavaScript-Interop-Basics.aspx


The full answer to this question can be found at:

Silverlight passing JSON object incorrectly?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号