在我的控制器中:
public ActionResult Question(string id, int status = 1, int? page = 1, int? pageSize = 20) { //... }
RouteConfig:
routes.MapRoute(
name: "Route_UserQuestion",
url: "User/{action}/{id}/{status}/{page}/{pagesize}.html",
defaults: new { controller = "User", action = "Question", status = UrlParameter.Optional, page = UrlParameter.Optional, pagesize = UrlParameter.Optional }
);
但这是错误的,我想要一个配置来实现几个网址:
/User/Question/1234.html
/User/Question/1234/2.html
/User/Question/1234/2/1.html
/User/Question/1234/2/1/20.html
谢谢!