ASP.NET MVC - MapRoute versus routes.Add (and 404s)

前端 未结 3 1424
悲哀的现实
悲哀的现实 2021-02-02 12:28

I\'m just getting started with ASP.NET MVC.

What is the difference between MapRoute and routes.Add ? Should I just be using MapRoute? Can I map multiple routes? Which \"

3条回答
  •  感动是毒
    2021-02-02 13:07

    MapRoute() is an extension method over Routes.Add(). Use MapRoute(), unless you need to do something more complex than it allows.

    Routes are evaluated in the order they are defined, so those you called first.

提交回复
热议问题