I am developping a web application by using the ASP .NET MVC 3 framework.
I have implemented an ASPX ViewPage containing a CrystalReportViewer control.
I have got help by looking at the project downloadable at : http://hasibulhaque.com/?p=244
Here is the action sequence to load my ASPX ViewPage :
My ASPX ViewPage is in a folder named AspNetForms.
The folder AspNetForms is under the root of my project.
I have made a test.
I have moved the AspNetForms folder under the Views folder.
Then I have updated the redirection written in the action method.
But then I have faced a 404 HTTP error when I have tried to load my ASPX ViewPage.
Does someone can explain to me what is so special about the Views folder ?
I am not sure whether the routing has something to do with my HTTP error.
For information here is my RegisterRoutes method as written in the Global.asax.cs file :
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
// Default parameters
new { controller = "Accueil", action = "Accueil", id = UrlParameter.Optional }
);
}
The View folder contains a web.config file with the following lines:
<handlers>
<remove name="BlockViewHandler"/>
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" />
</handlers>
This special handler blocks all access to the Views folder. If you remove those lines you will be able to access your ASPX page. These lines are their for security reasons. If you remove them all your razor views can also be viewed directly.