Master Page Code Blocks
I've been working with converting some old-style ASPX pages to use ASP.NET 2.0 Master Pages. ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps is a nice summary of how to use master pages. One thing that I ran into was that a <% %> code block inside the bgcolor attribute of a <body> tag caused all kinds of funny behavior. Ultimately, the "The Controls collection cannot be modified because the control contains code blocks (i.e. <% … %>)." error caused me to track down the problem. Milan Negovan posted on having this problem inside <head>, but in my case this was the body tag that caused the grief. The thing is that it was broken in subtle ways at first: one page was functionally OK, but the layout was broken, another page wouldn't save changes posted back to the server. It seems to me that it would be safer to stay away from code blocks in the master page altogether.