解決 The Controls collection cannot be modified because the control contains code blocks
來(lái)源:懂視網(wǎng)
責(zé)編:小采
時(shí)間: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中的控件,那么很可能會(huì)引發(fā)The Controls collection cannot be modified because the control contains code blocks 異常, 解決辦法
導(dǎo)讀解決 The Controls collection cannot be modified because the control contains code blocks:在.aspx或.ascx的如果包括<%= %>,并在.aspx, .ascs中使用了AjaxToolkit中的控件,那么很可能會(huì)引發(fā)The Controls collection cannot be modified because the control contains code blocks 異常, 解決辦法
在.aspx或.ascx的如果包括<%= %>,并在.aspx, .ascs中使用了AjaxToolkit中的控件,那么很可能會(huì)引發(fā)"The Controls collection cannot be modified because the control contains code blocks" 異常,
解決辦法如下
1. 將<%= 換為<%#
2. 在.asp或模板頁(yè)中的Page_Load事件中添加如下代碼
代碼如下:
Page.Header.DataBind();
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。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中的控件,那么很可能會(huì)引發(fā)The Controls collection cannot be modified because the control contains code blocks 異常, 解決辦法