Wednesday, 25 November 2015

SearchResult.aspx: Code blocks are not allowed in this file.

Recently I was working with search bar in search result page where I encounter below error:

Sorry, Something went wrong
An error occurred during the processing of /sites/search/_catalogs/masterpage/searchresults.aspx. Code blocks are not allowed in this site.


Solution:

1. Open Web.config
2. find <PageParserPath>
3. Add below line in it.

<PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />

No comments:

Post a comment