i saw few of solutions f开发者_开发百科or this exception (like putting it in place holder, or replace the <% to <# ...etc) , but i don't get the idea about it, i mean what is the controls collection? and why it can't be modified if the added control contains code blocks ?
I think the idea is to not create contention on the content of the element between the code in the <%%> tags and the code-behind file. They both change the content of the element and asp.net doen`t know who needs to "win".
I would expect code blocks to be called during Render, while much of the server-side control behaviour happens before render.
精彩评论