Tuesday, July 15, 2008

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

If you have this exception, with wired error message and the stack trace is some how freeek.

Simply, this exception occurs when you have a server side call from javascript located at the head tag of the html like that
< head runat="server" >
< script >
var controlClientObject = <%= RadControl1.ClientID %>
...
< / script>


<
body >
...

you should do that

< head runat="server" >

<
body >
< script >
var controlClientObject = <%= RadControl1.ClientID %>
...
< / script >
...

I googled a lot and this is what concluded.

ref. http://www.telerik.com/help/aspnet/menu//menu_move_codeblocks.html
Zemanta Pixie

No comments:

Post a Comment