Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Asp.net-JVector映射中使用JSON动态添加JavaScript代码_Asp.net_C# 4.0_Visual Studio 2013 - Fatal编程技术网

在Asp.net-JVector映射中使用JSON动态添加JavaScript代码

在Asp.net-JVector映射中使用JSON动态添加JavaScript代码,asp.net,c#-4.0,visual-studio-2013,Asp.net,C# 4.0,Visual Studio 2013,我正在使用JVector地图,并使用标记在地图上的一些位置。 根据文档,以下代码可用于标记位置 markers: [ { latLng: [53.3574436, 9.9076650], name: 'some city' }, { latLng: [53.3574436, 10.2127204], name: 'another city' }, { latLng: [56.5611120, 24.0300030], name: '

我正在使用JVector地图,并使用标记在地图上的一些位置。 根据文档,以下代码可用于标记位置

 markers: [

          { latLng: [53.3574436, 9.9076650], name: 'some city' },
          { latLng: [53.3574436, 10.2127204], name: 'another city' },
          { latLng: [56.5611120, 24.0300030], name: 'one more city' }

        ]

就我而言,我不确定需要标记多少个位置。有时是3,有时是5。所以我想知道的是,可以使用JSON动态地在
标记:[]
内生成代码。或者可能是其他方式

您可以使用ClientScriptManager.RegisterClientScriptBlock添加代码

见:

或者您可以在带有标记的标记中进行内联操作