ASP.NET MVC: routing help

Posted by pcampbell on Stack Overflow See other posts from Stack Overflow or by pcampbell
Published on 2010-03-25T03:37:28Z Indexed on 2010/03/25 3:43 UTC
Read the original article Hit count: 699

Consider two methods on the controller CustomerController.cs:

//URL to be http://mysite/Customer/
public ActionResult Index()
{
    return View("ListCustomers");
}

//URL to be http://mysite/Customer/8
public ActionResult View(int id)
{
    return View("ViewCustomer");
}
  • How would you setup your routes to accommodate this requirement?
  • How would you use Html.ActionLink when creating a link to the View page?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about asp.net-mvc-routing