我想点某一个链接可以直接通过比如 http://www.mysite.com/shanghai,http://www.mysite.com/beijing之类的来访问,但是现在貌似只能是这样的格式才能访问http://www.mysite.com/Home/index/shanghai,route应该怎么改? routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
new string[] { "tougou.Controllers" });
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
new string[] { "tougou.Controllers" });
"Default", // Route name
"{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
new string[] { "tougou.Controllers" });
routes.MapRoute(
"Default", // Route name
"{id}", // URL with parameters
new { controller = "Home", action = "Index", id = "beijing" },
new string[] { "tougou.Controllers" });