Welcome Guest Search | Active Topics | Sign In | Register

Passing objects through JSExtInvokeHandler Options
James
Posted: Tuesday, August 29, 2017 1:29:15 PM
Rank: Advanced Member
Groups: Member

Joined: 2/11/2015
Posts: 122
I'd like register this function with my WebView;

public void SaveQuestion(string question, IEnumerable<KeyValuePair<string, string>> message)

message is details used to generate a state used by the question later. In the past we have handled this by taking in json strings and deserializing them, however I was hoping going forward I could use a cleaner approach.

Is there any way I can make this, or something like this work?
eo_support
Posted: Tuesday, August 29, 2017 3:02:56 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
Hi,

No. Json string is probably the most efficient way for this. In theory you could pass a complex JavaScript object to the .NET side, but doing so would only pass a "handle" to the .NET side and any subsequent access to any member/methods on that object would require a round trip back to the JavaScript, which would be much worse in term of performance comparing with Json. So Json is still the best approach (or whatever other serialization mechanism that's easy to use/implement for you).

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.