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 \"
Use!
public class MvcApplication : System.Web.HttpApplication
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"User",
"User/{domain}/{username}",
new { controller = "User", action = "Index", username= UrlParameter.Optional }
);
}
protected void Application_Start()
{
RegisterRoutes(RouteTable.Routes);
}
}