C# List<string> to JavaScript String Conversion -


i have c# list<string>, , need convert javascript list of strings.

i'm stuck at:

system.web.script.serialization.javascriptserializer oserializer =         new system.web.script.serialization.javascriptserializer(); test = oserializer.serialize(tempstring); 

in javascript, can (test protected string variable)

var servervalue = '<%=test %>'; 

in console get

var servervalue = '["100000001","200000002","200000003","300000006","300000007"]'; 

and need without single quotation marks, this:

["100000001", "200000002", "200000003", "300000006",                                        "300000007"]; 

if don't want list wrapped ' quotes, can fix removing quotes appear around <%=test %> in code.

var servervalue = <%=test%>; 

Comments