摘要: 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 阅读全文
posted @ 2013-05-26 23:53 chunchill 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 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.... 阅读全文
posted @ 2013-05-26 23:06 chunchill 阅读(356) 评论(0) 推荐(0) 编辑