Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

SEO toolkit controls collection error

Modified: 2009/01/28 15:16 by vanthoog - Categorized as: Sitecore
Sitecore has a great module for improving the page ranking of your webpages in search engines and for making the content more search engine friendly. This module is called the SEO (Search Engine Optimization) toolkit. More information about the SEO toolkit can be found here.

After installing the SEO toolkit it should just work. However, on some pages you may get the following error:

System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

The full details of this error are:

SEO toolkit error

SEO toolkit error

This error occurs if you have used a <% = %> codeblock in a aspx-file or ascx-file. The solution is to get rid of all the <% = %> codeblocks. Although this sounds easy, it does require some code rewriting. You might for example replace the <% = %> codeblocks by <% # %> codeblocks (i.e. by a databinding expression) or by a literal which is filled by your code-behind.

 © Evident Interactive BV