【发布时间】:2016-02-12 15:48:26
【问题描述】:
我有一个在 asp.net 框架上使用 SVG 坐标的网页。
通过试错,如果我取出大部分标签,我不会收到任何错误。但是如果所有标签都在我得到以下错误
Compiler Error Message: CS8095: Length of String constant exceeds current memory limit. Try splitting the string into multiple constants.
Line 195: private global::System.Web.UI.LiteralControl @__BuildControl__control2() {
Line 196: global::System.Web.UI.LiteralControl @__ctrl;
Line 197: @__ctrl = new global::System.Web.UI.LiteralControl("\r\n\r\n \r\n<div class=\"row\">\r\n <div class=\"col-xs-24 banner section\">\r\n " +
Line 198: "<div class=\"row\">\r\n<div class=\"col-xs-24 col-sm-14 map-container\"> <!-- MICHAEL:" +
Line 199: " be sure to add the class \'map-container\', this is for the tooltip location -->\r" +
源码是
<div class="col-xs-24 col-sm-14 map-container"> <!-- MICHAEL: be sure to add the class 'map-container', this is for the tooltip location -->
<!-- <img class="map" src="images/map.svg" width="100%"> -->
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 230.5 613.3 331" enable-background="new 0 230.5 613.3 331" xml:space="preserve">
<g>
<polygon fill="#FFFFFF" points="609.6,301.2 609.4,301.1 609.3,301.1 609.1,301 609,300.9 608.8,300.8 608.6,300.7 608.5,300.6
608.4,300.4 608.3,300.3 608.2,300.1 608.1,299.9 608.1,299.8 608,299.6 608,299.4 608,299.2 608,299 608,298.9 608.1,298.7
608.1,298.4 608.2,298.3 608.3,298.1 608.4,298 608.5,297.9 608.6,297.7 608.8,297.6 609,297.5 609.1,297.4 609.3,297.3
609.4,297.3 609.6,297.2 609.8,297.2 610,297.2 610.2,297.2 610.4,297.2 610.5,297.3 610.8,297.3 610.9,297.4 611.1,297.5
611.2,297.6 611.4,297.7 611.5,297.9 611.6,298 611.7,298.1 611.8,298.3 611.9,298.4 611.9,298.7 612,298.9 612,299 612,299.2
612,299.4 612,299.6 611.9,299.8 611.9,299.9 611.8,300.1 611.7,300.3 611.6,300.4 611.5,300.6 611.4,300.7 611.2,300.8
611.1,300.9 610.9,301 610.8,301.1 610.5,301.1 610.4,301.2 610.2,301.2 610,301.2 609.8,301.2 "/>
<polygon fill="#FFFFFF" points="601.2,301.1 601.3,301 601.4,300.8 601.5,300.7 601.7,300.6 601.9,300.5 601.9,300.5 602.1,300.4
602.2,300.4 602.4,300.3 602.6,300.3 602.7,300.3 602.8,300.3 602.9,300.3 603.1,300.3 603.4,300.4 603.5,300.4 603.6,300.5
603.8,300.6 604,300.7 604.2,300.8 604.3,301 604.3,301.1 604.5,301.2 604.6,301.4 604.6,301.5 604.7,301.8 604.8,301.9
604.8,302.1 604.8,302.4 604.8,302.5 604.8,302.7 604.7,302.9 604.6,303 604.6,303.2 604.5,303.3 604.3,303.5 604.3,303.7
604.2,303.8 604,303.9 603.8,304 603.6,304.1 603.5,304.2 603.4,304.2 603.1,304.3 602.9,304.3 602.8,304.3 602.6,304.3
602.4,304.3 602.2,304.2 602.1,304.2 601.9,304.1 601.7,304 601.5,303.9 601.4,303.8 601.3,303.7 601.2,303.5 601.1,303.3
601,303.2 600.9,303 600.8,302.9 600.8,302.7 600.8,302.5 600.8,302.4 600.8,302.1 600.8,301.9 600.8,301.8 600.9,301.5 601,301.4
601.1,301.2 "/>
+8000 多行
我能做什么?我需要使用元素标签,因为使用 jquery 我将在这些标签上发生事件。所以我不能只指向文件。我需要所有
更新我将内联多边形标签缩小到 898kb 的 1 行,我注意到 VSBComplier.exe(类似的东西)占用了我的所有 RAM 并使我的浏览器崩溃。
仍然必须在注释中取出 svg 才能进行调试。
【问题讨论】:
-
缩小范围:将标签汤分成两半,弄清楚是内容的数量/长度,还是某个格式错误的标签?您的“错误描述”包含源代码行和 ASP 运行时生成的代码,但没有错误消息:是否有错误代码或异常文本?
-
我已经这样做了,如果我使用更少的代码,它就可以工作。但我需要所有这些代码。错误文本已在上述问题中发布。它说我使用文字控件,但我不是
-
ASP.NET 在某些情况下在后台创建文字控件。您发布的那部分页面源代码似乎嵌入在
<div class="row">中 - 当我们进一步上升时,该标记层次结构是什么样的?它是母版页或更新面板结构的一部分吗? -
+1 表示原创性。在这里,ASP.NET 似乎强加了一个限制,而实际上应该没有限制。第一个想法:通过将标记加载到
<iframe>并让您的 jquery 在<iframe>的 DOM 上运行来规避它 -
this 建议需要以不同的方式嵌入 xml。也是 IMO,
<?xml version...>是文档标题,不能出现在 html 文档的中间。尝试只删除这一行。
标签: javascript jquery asp.net svg responsive-images