It was working just fine until I put an ajax calendar control in one of my page. Suddenly the page failed with the error below:
"The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). "
Once I removed the entire line using the literal tag, it is working again.
code behind looks like:
So for some reason the ajax controls doesn't like <%= %> in the <head runat="server"> section. This is under .net 4 with ajax tool kit for .net 4.