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,改这个要改很多,不理智

解决方案 »

  1.   

    大哥,你的那个帖子我说错了,刚才查了一下,是这样的:如果一个URL匹配了一条路由,则不继续查找之后的路由。也就是说,你写了两个,如果匹配了一个,后面那个将被忽略。我又想了个主意,通过路由名称来指定对应的规则
    比如在涉及到路由连接的时候,可以用<%Html.RouteLink("xxxx","RouteName",new{goodsId="xxx",cType=""})%>的形式
      

  2.   

    一直觉得 MS的 MVC 很 SB "Product/{goodsId}/{cType}/"  80%不行
      

  3.   

    在页面引用站内url用:Url.Action...下面的方法,避免写死带来的麻烦
    RouteTable是查找 url来匹配,如果查到就直接返回!
    你的当然有问题了!