Monday, September 12, 2011

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

This error came because, in my master page there was a java script function like below

document.getElementById("<%=lblShoppingCart.ClientID %>").style.color = "#6CA2DE"

I used <%# instead of using <%=. It's work fine.

Here some valuable links related to this topic.

http://leedumond.com/blog/the-controls-collection-cannot-be-modified-because-the-control-contains-code-blocks/

http://www.west-wind.com/weblog/posts/2006/May/27/The-Controls-collection-cannot-be-modified-because-the-control-contains-code-blocks-ie-

No comments:

Post a Comment

I Built a New Kind of Number Puzzle Game (And You Can Play It Free)

 For a long time, I wanted to play a mobile puzzle game that felt genuinely strategic—something that required real brainpower, skipped the a...