| The Controls collection cannot be modified-because the control contains code blocks error |
|
When you run the asp.net page you get the error "The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)". There are a few work around to this error and its depend on your situation. 1. Firstly if you put the runat="server" in the <head> tag then you might be able to solve this error by taking out the runat="server" So instead of using <head runat="server"> Try <head> 2. In you code instead of using <%= myControl.ClientID %> try to use <%# myControl.ClientID %>. So instead of using <%= notation Try <%# notation. If you are getting this error when using the Telerik suite then try the put your script code inside the RadCodeBlock .
|