I was getting the following message whenever I tried something a little more complicated than request.write(now).
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
After looking around I found that the error was that ASP.NET 2.0 and not ASP.NET 4.0 was installed.
Go to Control Panel > Administrative Tools > IIS
Right click on WebSite > Properties > ASP.NET > Version >
It should be some version of 4.0 and not 2.0
Don't forget to restart IIS.