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

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -