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?
|
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!
|