我正在编写一个 .net 2.0 网站项目,并且很高兴地使用SquishIt一段时间来通过 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
如您所见,我们也在站点内使用 Telerik 控件,所以我怀疑这是问题所在。
我尝试使用 SquishIt API 从后面的代码中调用 Add 和 Render 命令,但它根本没有产生任何结果。
有任何想法吗?我宁愿不要放弃 SquishIt,因为它在其他方面表现出色。