One workaround you could try is to drop a web.config in the same directory and set the target framework.
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</configuration>
When VS opens an ASPX file outside any projects (called a miscellaneous file), I believe it looks for a web.config file in the same directory, or else assumes 2.0.