解决 The Controls collection cannot be modified because the control contains code blocks (i.e. )问题
2011-02-24 12:08
579 查看
原帖地址:/article/7035919.html
在.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();
在.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();
相关文章推荐
- 解决 The Controls collection cannot be modified because the control contains code blocks
- 解决 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 (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. <% ... %>).
- 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
- 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 (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. ). .
- 解决Entity Framework Code First 的问题——Model compatibility cannot be checked because the database does not contain model metadata
- Control cannot be created because Visual Studio cannot find the control's type in the control assembly 问题的解决
- 如何解决打开xcode项目是遇到的“cannot be opened because the project file cannot be parsed.”问题?