mirror of
https://github.com/rudollee/LearningMVC.git
synced 2026-08-11 16:32:55 +00:00
Ch. 16 Routing Adv (until 16-21)
This commit is contained in:
@@ -5,6 +5,7 @@ using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Mvc.Routing.Constraints;
|
||||
using UrlsAndRoutes.Infrastructure;
|
||||
|
||||
namespace UrlsAndRoutes
|
||||
{
|
||||
@@ -71,10 +72,16 @@ namespace UrlsAndRoutes
|
||||
|
||||
routes.MapMvcAttributeRoutes();
|
||||
|
||||
routes.MapRoute("NewRoute", "App/Do{action}", new { controller = "Home" });
|
||||
//routes.MapRoute("NewRoute", "App/Do{action}", new { controller = "Home" });
|
||||
|
||||
//routes.MapRoute("MyRoute", "{controller}/{action}/{id}",
|
||||
// new { controller = "Home", action = "Index", id = UrlParameter.Optional });
|
||||
|
||||
routes.Add(new LegacyRoute("~/articles/Windows_3.1_Overview.html", "~/old/.NET_1.0_Class_Library"));
|
||||
|
||||
routes.MapRoute("MyRoute", "{controller}/{action}");
|
||||
routes.MapRoute("MyOtherRoute", "App/{action}", new { controller = "Home" });
|
||||
|
||||
routes.MapRoute("MyRoute", "{controller}/{action}/{id}",
|
||||
new { controller = "Home", action = "Index", id = UrlParameter.Optional });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user