I have experienced this error when I inserted some server side code into a SharePoint page. The reason for this is, the web server is configured for not to allow server side code in pages. You can modify this configuration in the web configuration file as described below.
Open web.config file and put the following code block in it.
<PageParserPath VirtualPath=”/pages/test.aspx” CompilationMode=”Always” AllowServerSideScript=”true” />