C
Chris Marsh
All
I've just stated playing with the MVC framework included in the ASP .NET
Extensions release, but I'm hving trouble with the default settings.
I have created a default ASP .NET MVC Web Application, which includes a
default controller (HomeController) and two default views (Index and About).
The routes in Global.asax are as follows:
RouteTable.Routes.Add(new Route
{
Url = "[controller]/[action]/[id]",
Defaults = new { action = "Index", id = (string)null },
RouteHandler = typeof(MvcRouteHandler)
});
RouteTable.Routes.Add(new Route
{
Url = "Default.aspx",
Defaults = new { controller = "Home", action = "Index", id = (string)null },
RouteHandler = typeof(MvcRouteHandler)
});
However, only the second route appears to work. I would expect the first to
allow access to the Index page in a browser via the URL
http://localhost/Home/Index, but this gives an HTTP 404 error. I have
changed nothing in the default application, I have just built it and
attempted to access the pages in a browser. Can anyone give me any pointers
as to why this route does not appear to work?
Many thanks for any assistance!
I've just stated playing with the MVC framework included in the ASP .NET
Extensions release, but I'm hving trouble with the default settings.
I have created a default ASP .NET MVC Web Application, which includes a
default controller (HomeController) and two default views (Index and About).
The routes in Global.asax are as follows:
RouteTable.Routes.Add(new Route
{
Url = "[controller]/[action]/[id]",
Defaults = new { action = "Index", id = (string)null },
RouteHandler = typeof(MvcRouteHandler)
});
RouteTable.Routes.Add(new Route
{
Url = "Default.aspx",
Defaults = new { controller = "Home", action = "Index", id = (string)null },
RouteHandler = typeof(MvcRouteHandler)
});
However, only the second route appears to work. I would expect the first to
allow access to the Index page in a browser via the URL
http://localhost/Home/Index, but this gives an HTTP 404 error. I have
changed nothing in the default application, I have just built it and
attempted to access the pages in a browser. Can anyone give me any pointers
as to why this route does not appear to work?
Many thanks for any assistance!