日期:2014-05-18 浏览次数:20815 次
public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); List<string> language = Common.XMLHelper.GetValueAll_(); foreach (string str in language) { routes.MapRoute(Guid.NewGuid().ToString().Substring(0, 5), "{languages}", new { controller = "Book", action = "Index", languages = str }); } routes.MapRoute( "Default", // 路由名称 "{controller}/{action}/{id}", // 带有参数的 URL new { controller = "Book", action = "Index", id = UrlParameter.Optional } // 参数默认值 ); }