I assume this is a C# ASP.NET website and you're making use of the page render function in your <% %> blocks.
Since you want to get a server-side array into a client-side array, just do this:
Define some function in your page's superclass (aka codebehind) like so:
protected String ToEcmaScriptArray<T>(T[] items) {
StringBuilder sb = new StringBuilder();
sb.Append(" [ " );
for(int i=0;i<items.Length;i++) {
sb.Append("\"");
sb.Append( items[i].ToString() ); // if T is a string, you might want to enclose this in quotes
sb.Append("\"");
if( i != items.Length - 1 ) sb.Append(", ");
}
sb.Append(" ] ");
}
///////////////////////////
then just do this in your client-side script:
var array = <%= ToEcmaScriptArray( marker ) %>;
which will be rendered
as a Javascript array literal like so:
var array = [ "marker1", "marker2", "marker3" ];