Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.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
.net 使用SquishIt并获取';无法修改控件集合,因为该控件包含代码块';错误_.net_Telerik_Squishit - Fatal编程技术网

.net 使用SquishIt并获取';无法修改控件集合,因为该控件包含代码块';错误

.net 使用SquishIt并获取';无法修改控件集合,因为该控件包含代码块';错误,.net,telerik,squishit,.net,Telerik,Squishit,我正在写一个.NET2.0网站项目,并且已经愉快地使用了一段时间来缩小并通过CSS和Javascript进行组合。我最近开始出现以下错误: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). HttpException (0x80004005): The Controls collection cannot be modified

我正在写一个.NET2.0网站项目,并且已经愉快地使用了一段时间来缩小并通过CSS和Javascript进行组合。我最近开始出现以下错误:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). 

HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.Add(Control child) +11035338
   Telerik.Web.SkinRegistrar.RegisterCssReference(Page _page, Control _control, String _url) +413

[HttpException (0x80004005): Please, see whether wrapping the code block, generating the exception, within RadCodeBlock resolves the error.]
   Telerik.Web.SkinRegistrar.RegisterCssReference(Page _page, Control _control, String _url) +533
   Telerik.Web.SkinRegistrar.RegisterCssReferences(ISkinnableControl _control) +828
   Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e) +32
   System.Web.UI.Control.PreRenderRecursiveInternal() +108
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Control.PreRenderRecursiveInternal() +224
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394
无法修改控件集合,因为控件包含代码块(即)。
HttpException(0x80004005):无法修改控件集合,因为控件包含代码块(即)。]
System.Web.UI.ControlCollection.Add(控件子级)+11035338
Telerik.Web.skinregistrator.registercsreference(Page\u Page,Control\u Control,String\u url)+413
[HttpException(0x80004005):请查看在RadCodeBlock中包装代码块生成异常是否可以解决错误。]
Telerik.Web.skinregistrator.RegisterCssReference(Page\u Page,Control\u Control,String\u url)+533
Telerik.Web.skinregister.registercsreferences(ISkinnableControl\u control)+828
Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e)+32
System.Web.UI.Control.PreRenderRecursiveInternal()+108
System.Web.UI.Control.PreRenderRecursiveInternal()+224
System.Web.UI.Control.PreRenderRecursiveInternal()+224
System.Web.UI.Control.PreRenderRecursiveInternal()+224
System.Web.UI.Control.PreRenderRecursiveInternal()+224
System.Web.UI.Control.PreRenderRecursiveInternal()+224
System.Web.UI.Control.PreRenderRecursiveInternal()+224
System.Web.UI.Control.PreRenderRecursiveInternal()+224
System.Web.UI.Page.ProcessRequestMain(布尔includeStagesBeforeAsyncPoint,布尔includeStagesAfterAsyncPoint)+3394
正如你所看到的,我们也在网站内使用Telerik控件,所以我怀疑这就是问题所在

我尝试使用SquishIt API从代码隐藏中调用Add和Render命令,但根本没有产生任何结果


有什么想法吗?我不想放弃SquishIt,因为它在其他方面表现得很好。

我找到了解决办法。事实证明,当您在站点中使用Telerik Rad控件时,如果母版页的页眉中有任何代码块,则需要包含一个特殊的代码块


有了这个标签,我现在可以毫无错误地使用SquishIt了

我找到了解决办法。事实证明,当您在站点中使用Telerik Rad控件时,如果母版页的页眉中有任何代码块,则需要包含一个特殊的代码块


有了这个标签,我现在可以毫无错误地使用SquishIt了

这比Telerik社区内容更有用,在那里,他们只是说将代码包装在
RadCodeBlock
中。他们不清楚现有的(显然不相关的)代码是否需要包装在
中。你的回答让我很满意,谢谢。这比Telerik社区的内容更有用,在那里,他们只是说用
RadCodeBlock
包装代码。他们不清楚现有的(显然不相关的)代码是否需要包装在
中。你的回答让我很满意,谢谢。