
public class HomeController : Controller
{
public ActionResult FriendlyUrl()
{
ViewBag.Message = "Friendly Url page.";
return View();
}
}
PM> Install-Package LowercaseDashedRoute
routes.Add(new LowercaseDashedRoute("{controller}/{action}/{id}",
new RouteValueDictionary(
new { controller = "Home", action = "Index", id = UrlParameter.Optional }),
new DashedRouteHandler()
)
);var route = new LowercaseDashedRoute("AreaName/{controller}/{action}/{id}",
new RouteValueDictionary(
new
{
action = "Index",
id = UrlParameter.Optional
}),
new DashedRouteHandler(),
this,
context
);
context.Routes.Add("AreaName_default", route);站长苏飞 发表于 2015-9-1 16:16
我只是路过打酱油的。
| 欢迎光临 苏飞论坛 (http://www.sufeinet.com/) | Powered by Discuz! X3.4 |