When running a ASP.NET 3.5 project in Visual Studio 2010's Casini, I receive the following error:
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.aspx' may be incorrect.
Pl开发者_StackOverflow社区ease review the URL below and make sure that it is spelled correctly.Requested URL: /default.aspx
Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955
This is a project running in visual studio 2010 in windows 7 64 bit on .NET 3.5
The same error occurs in IIS, although IIS is configured to handle .aspx:
I also executed aspnet_regiis /i from the 2.0.50727 .net folder:
C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -i
Finished installing ASP.NET (2.0.50727).
I concluded the following
- Check the target framework of your project.
- Also check if default.aspx exists on the disk. If you are redirecting or accessing the page try using ~/DirName/Pagename.aspx if inside root , in some directory or ~/page.aspx if in the root itself. Also .Aspx files are by default added to IIS or any webserver that supports asp.net.
精彩评论