开发者

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

开发者 https://www.devze.com 2023-02-19 20:27 出处:网络
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 colle

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消