Reputation: 5459
i saw few of solutions for 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 ?
Upvotes: 0
Views: 798
Reputation: 10581
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".
Upvotes: 1
Reputation: 22859
I would expect code blocks to be called during Render, while much of the server-side control behaviour happens before render.
Upvotes: 0