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 :
- An action method of a controller is called.
- A redirection to the ASPX ViewPage is made.
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 }
);
}