|
Hi,
I see the only way of doing this is by using Dictionary<string, object> like this:
Dictionary<string, object> contact = new Dictionary<string, object>();
contact.Add("Surname", "Fred");
contact.Add("Forename", "Smith");
context.SetParameter("contact", contact);
The from within JavaScript you can use it as an object:
console.print(contact.Forename);
console.print(contact.Surname);
But I found a couple of concerns (I don't know if by design):
1) That if I specify contact.Age = 38 in JavaScript, the .NET Dictionary doesn't have the new item. I get an exception even with contact.Add('Age', 38);
2) Or event contact.Forename = 'Joe' doesn't change the existing value.
|