08 June 2012

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

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). 
Use <%# this.txtCompany.ClientID %> to replace <%= this.txtCompany.ClientID %> to fix the problem.

Once those changes are done then run the application if your not getting the values of controls(getting balnk ("") value instead of Client id) then follow the below step.

Re-place (<%# ... %>) with (<%= ...%>) and put your script from "head" tag to "body" tag.


Ref Link:- 
http://www.west-wind.com/weblog/posts/2006/May/27/The-Controls-collection-cannot-be-modified-because-the-control-contains-code-blocks-ie-
http://www.dotnet-tips.com/2006/09/controls-collection-cannot-be-modified.html

No comments:

Post a Comment