解决 The Controls collection cannot be modified because the control contains code blocks
来源:
中文源码网 浏览:271 次 日期:2024-05-07 16:49:27
【下载文档: 解决 The Controls collection cannot be modified because the control contains code blocks.txt 】
解决 The Controls collection cannot be modified because the control contains code blocks
在.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();