如何进行如下路由配置?
我目前的网址是:http://localhost:4815/Home/ByCategory/1
但我希望它是:http://localhost:4815/CategoryTitle
public ActionResult ByCategory(int? id)
{
...
}
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "ByCategory", id = UrlParameter.Optional }
);