The Controls collection cannot be modified because the control contains code blocks (i.e. ).

Check your header section, if there is something like <%= xyz%>

Change that to <%# xyz%>

and add following code to code behind.

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
Page.Header.DataBind();
}

For More Details :

http://www.aspnetresources.com/blog/code_blocks_inside_master_pages_cause_trouble.aspx

About Sujeet Roy

One of the best business analyst in India.

Posted on March 24, 2010, in Errors, Uncategorized. Bookmark the permalink. Leave a comment.

Leave a comment