C# 以编程方式向Bing地图添加多段线

C# 以编程方式向Bing地图添加多段线,c#,javascript,asp.net,bing-maps,C#,Javascript,Asp.net,Bing Maps,我的dropdownlist中有路由名称,数组中有lat/log(多段线)和事件对应关系。如何将此lat/日志从代码隐藏发送到javascript <head> <title></title> <meta name="viewport" content="width=device-width,initial-scale=1.0"/> <script type="text/javascript" src="http://ec

我的dropdownlist中有路由名称,数组中有lat/log(多段线)和事件对应关系。如何将此lat/日志从代码隐藏发送到javascript

<head>
  <title></title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0"/>
    <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
    <script type="text/javascript">         
      function GetMap() {           
          // Initialize the map              
          var mapOptions = {
              credentials: "xxxx",
              center: new Microsoft.Maps.Location( 9.74, 2.425),
              mapTypeId: Microsoft.Maps.MapTypeId.road,
              zoom: 13,
              showScalebar: false
          }
          var map = new Microsoft.Maps.Map(document.getElementById("mapDiv"), mapOptions);
          var lineVertices = new Array(new Microsoft.Maps.Location(<%@new pts%>));
          var line = new Microsoft.Maps.Polyline(lineVertices);
          map.entities.push(line);
      }
    </script>
   <style type="text/css">
       #form1
       {
           width: 480px;
       }
   </style>
有一种方法可以将这些点发送到js?

您可以试试

     Dim oGeocodeList As New List(Of [String])()
    oGeocodeList.Add(" '37.968002524107035, 23.702445030212402' ")
    oGeocodeList.Add(" '37.969, 23.705445030212402' ")
    oGeocodeList.Add(" '37.97, 23.709445030212402' ")
      Dim geocodevalues = String.Join(",", oGeocodeList.ToArray())
    ClientScript.RegisterArrayDeclaration("locationList", geocodevalues)
用javacrtipt

 var locationList;
我为vb代码感到抱歉

     Dim oGeocodeList As New List(Of [String])()
    oGeocodeList.Add(" '37.968002524107035, 23.702445030212402' ")
    oGeocodeList.Add(" '37.969, 23.705445030212402' ")
    oGeocodeList.Add(" '37.97, 23.709445030212402' ")
      Dim geocodevalues = String.Join(",", oGeocodeList.ToArray())
    ClientScript.RegisterArrayDeclaration("locationList", geocodevalues)
 var locationList;