1. 首页
  2. 数据库
  3. 其它
  4. 解决 The Controls collection cannot be modified because the control contains code

解决 The Controls collection cannot be modified because the control contains code

上传者: 2021-01-31 20:57:42上传 PDF文件 20.8KB 热度 6次
在.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();
下载地址
用户评论