where to use route-name of routing in aspnet mvc

Posted by FosterZ on Stack Overflow See other posts from Stack Overflow or by FosterZ
Published on 2010-05-19T12:13:41Z Indexed on 2010/05/31 8:02 UTC
Read the original article Hit count: 329

Filed under:
|

hi,i'm new to routing in aspnet mvc.. i have following code: Action Controller


public ActionResult SchoolIndex()
{
    return View(SchoolRepository.GetAllSchools());
}

here is the routing


routes.MapRoute(
"School",                                              // Route name
"{controller}/{action}/{id}",                           // URL with parameters
new { controller = "School", action = "SchoolIndex", id = "" } ); // Parameter defaults


when i enter "localhost/school" in addressbar, it is giving 404 error instead it should route to my "schoolIndex" action

i have given route-name as "School" where it is used ?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about asp.net-mvc