I am currently having the same issue with my 2013 search site.
here is the article helped me.
I was still having the same error after following the article above. I have added the line below in the web.config
<PageParserPath VirtualPath="/*" CompilationMode="Always" AllowServerSideScript="true" IncludeSubFolders="true" />
After this, the error has disapeared. This is not a very good solution because it is allowing all pages to run server side scripts.
You can use this to limit the pages VirtualPath="~/_catalogs/masterpage/*"