激活条件块

时间:2012-09-13 23:36:31

标签: c# asp.net asp.net-mvc razor

我创建了这段代码但是出现了错误( la compilation conditionnelleestdésactivée)所以问题是什么以及如何纠正呢

@model IEnumerable<MvcApplication7.Models.GoogleMarker>
@using System.Threading;
@using System.Globalization;
@{

    Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
}
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Lay2.cshtml";
}
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script  type="text/javascript">
    $(document).ready(function () {
    var bounds = new google.maps.LatLngBounds();
    var options = {
        zoom : 14,
        mapTypeId: google.maps.MapTypeId.TERRAIN
    };
    var googleMap = new google.maps.Map($("#map")[0],options);
    var infoWindow = new google.maps.InfoWindow({ content: "Cargando…" });
    @foreach (var marker in Model){
    <text>
        var point = new google.maps.LatLng(@marker.Latitude, @marker.Longitude);
        bounds.extend(point);
      var marker = new google.maps.Marker({ position: point,map: googleMap,icon:'/Content/images/ui-bg_glass_75_e6e6e6_1x400.png.png',html: '@marker.InfoWindow'});

        google.maps.event.addListener(marker, "click", function () {infoWindow.setContent(this.html);infoWindow.open(googleMap, this);});
    </text>
    }
    googleMap.fitBounds(bounds);}
    );
     </script>

有什么建议吗?

0 个答案:

没有答案
相关问题