The Controls collection cannot be modified because the control contains code blocks

Error:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]

 

Solution:

(1)

Try removing the runat=server setting in the head tag as well.

<head id="MasterHead" runat="server" >

 

(2)

Replace all your <%=  %> tags with <%#  %>

(3)

you need to move the javascript code block outside of the head tag.

posted @ 2009-05-29 19:37  emanlee  阅读(448)  评论(0编辑  收藏  举报