解决 The Controls collection cannot be modified because the control contains code blocks
来源:懂视网
责编:小采
时间:2020-11-27 22:43:03
解决 The Controls collection cannot be modified because the control contains code blocks
解决 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 异常, 解决办法
导读解决 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 异常, 解决办法
在.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();
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
解决 The Controls collection cannot be modified because the control contains code blocks
解决 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 异常, 解决办法