62,046
社区成员
发帖
与我相关
我的任务
分享
routes.MapRoute(
"Defau1lt",
"{controller}/{id}-{cid}-{pid}",
new { controller = "Chapter", action = "List", id = 0, cid = 0, pid = 0 },
new { id = @"\d+", cid = @"\d+", pid = @"\d+" }
);
routes.MapRoute(
"Defau1lt",
"{controller}/{id}",
new { controller = "Chapter", action = "List", id = “” }
);
Action代码里面根据传入的字符串格式转换为你需要的参数
public ActionResult List(string id){
//处理id字符串
}