Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Host Function that returns dynamic object

$
0
0
Dear,

I am trying to access properties from a dynamic object that is returned from a c# call.
Example JS:
var xml = api.MyHostFunction();
var productId = xml.ProductId;
This is the prototype for MyHostFunction():
dynamic MyHostFunction();
ClearScript is throwing an exception when trying to access the ProductId property.
Debugging I can see that the property actually exists and can be accessed from any Host code. But its not possible to access it from JS:

TypeError: Cannot read property 'ProductId' of undefined

Am I doing anything wrong or ClearScript does not support this yet?

Thank you!

Viewing all articles
Browse latest Browse all 2297

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>