routes.MapRoute(
"Product",
"Product/{goodsId}.html",
new { controller = "Goods", action = "Goods", goodsId = Guid.Empty, cType = "Experience"}
); routes.MapRoute(
"ProductRe",
"Product/{goodsId}/{cType}",
new { controller = "Goods", action = "Goods", goodsId = Guid.Empty }
); routes.MapRoute(
"ProductAllParameter",
"Product/{goodsId}/{cType}/{page}.html",
new { controller = "Goods", action = "Goods", goodsId = Guid.Empty, page = @"[\d]{0,8}" }
);第二个和第三个在分页的时候好像都能匹配,致使controller走了2次,请教高手如何解决,不能更改Product,改这个要改很多,不理智
"Product",
"Product/{goodsId}.html",
new { controller = "Goods", action = "Goods", goodsId = Guid.Empty, cType = "Experience"}
); routes.MapRoute(
"ProductRe",
"Product/{goodsId}/{cType}",
new { controller = "Goods", action = "Goods", goodsId = Guid.Empty }
); routes.MapRoute(
"ProductAllParameter",
"Product/{goodsId}/{cType}/{page}.html",
new { controller = "Goods", action = "Goods", goodsId = Guid.Empty, page = @"[\d]{0,8}" }
);第二个和第三个在分页的时候好像都能匹配,致使controller走了2次,请教高手如何解决,不能更改Product,改这个要改很多,不理智
比如在涉及到路由连接的时候,可以用<%Html.RouteLink("xxxx","RouteName",new{goodsId="xxx",cType=""})%>的形式
RouteTable是查找 url来匹配,如果查到就直接返回!
你的当然有问题了!