<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Error Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/tag/error/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/tag/error/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Tue, 17 Mar 2020 10:30:52 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>SharePoint Online theme error &#8211; There was an error while attempting to get the themes</title>
		<link>https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/</link>
					<comments>https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/#comments</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Thu, 05 Mar 2020 07:24:47 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[SharePoint Online]]></category>
		<category><![CDATA[Theme]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1107</guid>

					<description><![CDATA[<p>Recently when I was trying to change the theme of a SharePoint online site collection, it threw an error &#8220;There was an error while attempting to get the themes&#8221; The error looks like the one shown below (Taken from Microsoft Tech Community) To fix this error, the easiest method as of March 2020 is do [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/">SharePoint Online theme error &#8211; There was an error while attempting to get the themes</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><img decoding="async" class="wp-image-1160" style="width: 32px;" src="https://blog.binarybits.net/wp-content/uploads/2020/03/microsoft-sharepoint-logo.svg" alt="Microsoft SharePoint Logo"> Recently when I was trying to change the theme of a SharePoint online site collection, it threw an error &#8220;There was an error while attempting to get the themes&#8221;</p>



<p class="has-normal-font-size">The error looks like the one shown below (Taken from <a href="https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-themes-there-was-an-error-while-attempting-to-get-the/m-p/319409">Microsoft Tech Community</a>)</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2020/03/error_theme.png"><img fetchpriority="high" decoding="async" width="298" height="328" src="https://blog.binarybits.net/wp-content/uploads/2020/03/error_theme.png" alt="There was an error while attempting to get the themes" class="wp-image-1108" srcset="https://blog.binarybits.net/wp-content/uploads/2020/03/error_theme.png 298w, https://blog.binarybits.net/wp-content/uploads/2020/03/error_theme-273x300.png 273w" sizes="(max-width: 298px) 100vw, 298px" /></a></figure>



<p>To fix this error, the easiest method as of March 2020 is do the following.</p>



<ol class="wp-block-list"><li>Click on &#8220;Classic change the look options&#8221; menu item shown in the screenshot above.</li><li>Choose one of the theme.</li><li>Preview it by clicking on &#8220;Try it out&#8221;.</li><li>Then click on &#8220;Yes, keep it&#8221;</li><li>Again load the home page</li><li>Try changing the theme, and the error should be gone.</li></ol>



<p>Thanks to Rob for providing the work around <a href="https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-themes-there-was-an-error-while-attempting-to-get-the/m-p/319409">here</a>.</p>
<p>The post <a href="https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/">SharePoint Online theme error &#8211; There was an error while attempting to get the themes</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Error &#8211; Code blocks are not allowed in this file</title>
		<link>https://blog.binarybits.net/sharepoint-error-code-blocks-are-not-allowed-in-this-file/</link>
					<comments>https://blog.binarybits.net/sharepoint-error-code-blocks-are-not-allowed-in-this-file/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 13 Feb 2012 12:40:43 +0000</pubDate>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Code blocks are not allowed in this file]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=215</guid>

					<description><![CDATA[<p>When I was adding an in-line code into master page I was getting the following error. An error occurred during the processing of /sites/&#60;collection&#62;/SitePages/Welcome.master. Code blocks are not allowed in this file. The fix is add the following code to the web.config of the web application which hosts the site collection.</p>
<p>The post <a href="https://blog.binarybits.net/sharepoint-error-code-blocks-are-not-allowed-in-this-file/">SharePoint Error &#8211; Code blocks are not allowed in this file</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>When I was adding an in-line code into master page I was getting the following error.</p>
<blockquote><p>An error occurred during the processing of /sites/&lt;collection&gt;/SitePages/Welcome.master. Code blocks are not allowed in this file.</p></blockquote>
<p>The fix is add the following code to the web.config of the web application which hosts the site collection.</p>
<pre class="lang:xhtml decode:true"><PageParserPaths>
<PageParserPath VirtualPath="/sites/site/_catalogs/masterpage/Welcome.master" CompilationMode="Always" AllowServerSideScript="true">
</PageParserPaths></pre>
<p>The post <a href="https://blog.binarybits.net/sharepoint-error-code-blocks-are-not-allowed-in-this-file/">SharePoint Error &#8211; Code blocks are not allowed in this file</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/sharepoint-error-code-blocks-are-not-allowed-in-this-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The Controls collection cannot be modified because the control contains code blocks (i.e. ).</title>
		<link>https://blog.binarybits.net/the-controls-collection-cannot-be-modified-because-the-control-contains-code-blocks-i-e/</link>
					<comments>https://blog.binarybits.net/the-controls-collection-cannot-be-modified-because-the-control-contains-code-blocks-i-e/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 13 Feb 2012 12:24:45 +0000</pubDate>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Controls collection cannot be modified]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=211</guid>

					<description><![CDATA[<p>While I was writing an in-line code with javascript inside the master page I was constantly facing the following exception. The Controls collection cannot be modified because the control contains code blocks (i.e. &#60;% … %&#62;). Welcome, &#60;script type=”text/javascript”&#62;var loginName = “&#60;%= SPContext.Current.Web.CurrentUser.Name %&#62;”;document.write(loginName);&#60;/script&#62; Found out that the javascript with c# code needs to be out of [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/the-controls-collection-cannot-be-modified-because-the-control-contains-code-blocks-i-e/">The Controls collection cannot be modified because the control contains code blocks (i.e. ).</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>While I was writing an in-line code with javascript inside the master page I was constantly facing the following exception.</p>
<blockquote><p>The Controls collection cannot be modified because the control contains code blocks (i.e. &lt;% … %&gt;).</p>
<p>Welcome, &lt;script type=”text/javascript”&gt;var loginName = “&lt;%= SPContext.Current.Web.CurrentUser.Name %&gt;”;document.write(loginName);&lt;/script&gt;</p></blockquote>
<p>Found out that the javascript with c# code needs to be out of the tag which has runat=&#8221;server&#8221;. After checking the code I re-wrote the code into 2 pieces</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;var loginName = &#8220;&lt;%= Microsoft.SharePoint.SPContext.Current.Web.CurrentUser.Name %&gt;&#8221;;&lt;/script&gt;</p></blockquote>
<p>The above code I moved out of the &#8220;&lt;form runat=&#8221;server&#8221;&#8230;&#8221; code and the below code inside the required location.</p>
<blockquote><p>&lt;span&gt;Welcome, &lt;script type=&#8221;text/javascript&#8221;&gt;document.write(loginName);&lt;/script&gt;&lt;/span&gt;</p></blockquote>
<p>Now the page is rendered properly.</p>
<p>&nbsp;</p>
<p>The post <a href="https://blog.binarybits.net/the-controls-collection-cannot-be-modified-because-the-control-contains-code-blocks-i-e/">The Controls collection cannot be modified because the control contains code blocks (i.e. ).</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/the-controls-collection-cannot-be-modified-because-the-control-contains-code-blocks-i-e/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Error &#8211; An unexpected error has occurred</title>
		<link>https://blog.binarybits.net/sharepoint-error-an-unexpected-error-has-occurred/</link>
					<comments>https://blog.binarybits.net/sharepoint-error-an-unexpected-error-has-occurred/#comments</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Mon, 13 Feb 2012 12:13:06 +0000</pubDate>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[An unexpected error has occurred]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[SharePoint]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=207</guid>

					<description><![CDATA[<p>While I was modifying SharePoint&#8217;s master page to put an inline code, I was constantly redirected to SharePoint Error Page &#8220;An unexpected error has occurred&#8221;. After spending nearly an hour to get a clue from EventLog and other sources, I found out that by adding the following config codes to web.config of the web application [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/sharepoint-error-an-unexpected-error-has-occurred/">SharePoint Error &#8211; An unexpected error has occurred</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>While I was modifying SharePoint&#8217;s master page to put an inline code, I was constantly redirected to SharePoint Error Page &#8220;An unexpected error has occurred&#8221;.</p>
<p>After spending nearly an hour to get a clue from EventLog and other sources, I found out that by adding the following config codes to web.config of the web application where the site collection resides, we can see the ASP.NET error page with detailed information.</p>
<blockquote>
<div>&lt;SafeMode MaxControls=&#8221;200&#8243; CallStack=&#8221;true&#8221;&gt;<br />
&lt;customErrors mode=&#8221;Off&#8221;/&gt;</div>
</blockquote>
<p>The post <a href="https://blog.binarybits.net/sharepoint-error-an-unexpected-error-has-occurred/">SharePoint Error &#8211; An unexpected error has occurred</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/sharepoint-error-an-unexpected-error-has-occurred/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-05-14 12:13:10 by W3 Total Cache
-->