摘要:
1.Generating Outgoing URLs in Views Rules: routes.MapRoute("MyRoute", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = UrlParameter.Optional }); } View: <div> @Html.ActionLink("This is an outgoing URL", "Cust 阅读全文
摘要:
1.所有的Routing 规则都存在RoutTable.Routes这个全局的Collection当中 RouteConfig.RegisterRoutes(RouteTable.Routes);2.下面是具体的方法,将所有的Routing规则注册到全局变量里。 public static void RegisterRoutes(RouteCollection routes) { Route myRoute = new Route("{controller}/{action}", new MvcRouteHandler()); routes.... 阅读全文