解决 The Controls collection cannot be modified because the control contains code blocks
2010-10-20 19:44
776 查看
在.aspx或.ascx的如果包括<%= %>,并在.aspx, .ascs中使用了AjaxToolkit中的控件,那么很可能会引发"The Controls collection cannot be modified because the control contains code blocks" 异常,
解决办法如下
1. 将<%= 换为<%#
2. 在.asp或模板页中的Page_Load事件中添加如下代码
复制代码 代码如下:
Page.Header.DataBind();
解决办法如下
1. 将<%= 换为<%#
2. 在.asp或模板页中的Page_Load事件中添加如下代码
复制代码 代码如下:
Page.Header.DataBind();
相关文章推荐
- 解决 The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- 解决 The Controls collection cannot be modified because the control contains code blocks (i.e. )问题
- 解决 The Controls collection cannot be modified because the control contains code blocks
- The Controls collection cannot be modified because the control contains code blocks (i.e. ).
- 错误:The Controls collection cannot be modified because the control contains code blocks (i.e. ). .
- asp.net当修改header时提示:The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
- 错误:The Controls collection cannot be modified because the control contains code blocks (i.e. ).
- The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
- 错误:The Controls collection cannot be modified because the control contains code blocks (i.e. ).
- The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- The Controls collection cannot be modified because the control contains code blocks
- The Controls collection cannot be modified because the control contains code blocks (i.e. ).
- The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- The Controls collection cannot be modified because the control contains code blocks
- The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)
- The Controls collection cannot be modified because the control contains code blocks (i.e. ).
- 解决MVC EF Code First错误:Model compatibility cannot be checked because the EdmMetadata type was not included in the model.
- Control cannot be created because Visual Studio cannot find the control's type in the control assembly 问题的解决
- C#错误:The Controls collection cannot be modified