zoukankan      html  css  js  c++  java
  • asp.net core mvc 中在C# 代码中写 js 或html 文本

    https://blog.csdn.net/orichisonic/article/details/62046621

    使用<text>这个伪元素来强制Razor从编译模式返回到内容模式:

    @foreach (varitem inModel) {
        <text>
          varmarkerlatLng = newgoogle.maps.LatLng(@(Model.Latitude), @(Model.Longitude));
          vartitle = '@(Model.Title)';
          vardescription = '@(Model.Description)';
          varcontentString = '<h3>'+ title + '</h3>'+ '<p>'+ description + '</p>'
      
          varinfowindow = newgoogle.maps.InfoWindow({
              content: contentString
          });
      
          varmarker = newgoogle.maps.Marker({
              position: latLng,
              title: title,
              map: map,
              draggable:false
          });
      
          google.maps.event.addListener(marker,'click',function() {
              infowindow.open(map, marker);
          });
      
       </text>
          }
    </script>

    --------------------- 本文来自 蓝色水 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/orichisonic/article/details/62046621?utm_source=copy

  • 相关阅读:
    排序算法(牢记)
    【性能优化】优化笔记之一:图像RGB与YUV转换优化
    wikioi 3027 线段覆盖 2
    浅谈HTTP响应拆分攻击
    HTTP Response Spliting 防范策略研究
    百度地图API使用介绍
    百度地图
    PHP htmlspecialchars() 函数
    CSRF防范策略研究
    SQL手工注入
  • 原文地址:https://www.cnblogs.com/LuoEast/p/9732291.html
Copyright © 2011-2022 走看看