var dict = new JavaScriptSerializer().Deserialize<Dictionary<string,object>>(node.GetPropertyValue("countries"));
//Array is also possible
string[] result = dict.Select(kv => kv.Value.ToString()).ToArray();
I tried adding your code to a test page and got the following compiler error
The type or namespace name 'JavaScriptSerializer' could not be found (are you missing a using directive or an assembly reference?)
I fixed this by fully qualifying the reference as follows
var dict = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize<Dictionary<string,object>>(node.GetPropertyValue("countries"));
This then gave the compiler error
The best overloaded method match for 'System.Web.Script.Serialization.JavaScriptSerializer.Deserialize<System.Collections.Generic.Dictionary<string,object>>(string)' has some invalid arguments
uDynamic checkbox values
Hi
I'm trying to retrieve the selected values in a uDynamic checkbox displaying countries. I'm currently using the following code to do this
This returns a comma delimited list of the keys associated with my selections
rather than the text values
How do I go about retrieving the selected text values?
Thanks
Jim
Hi Jim,
You can use jsonSerializer.
Hi Alex
Thanks for your reply.
I tried adding your code to a test page and got the following compiler error
I fixed this by fully qualifying the reference as follows
This then gave the compiler error
Do you have any idea how I might resolve this?
Thanks
Jim
is working on a reply...