<route name="TimeList" url="stage/list/{categID}/{propID}/{page}/{psize}" controller="Home" action="TimeList" >
<parameters>
<add name="categID" value="0" constraint="\d{1,10}" />
<add name="propID" value="0" constraint="\d{1,10}" />
<add name="page" value="1" constraint="\d{1,10}" />
<add name="psize" value="10" constraint="\d{1,10}" />
</parameters>
</route>
<route name="Article" url="article/{id}/{page}" controller="Home" action="Article" >
<parameters>
<add name="id" value="0" constraint="\d{1,10}" />
<add name="page" value="1" constraint="\d{1,10}" />
</parameters>
</route>
最简单的做法就是显示地给page赋值,这样就不会自动填充了
但是显示填充的这参数也显示出来了
<route name="Article" url="article/{id}/{page}" controller="Home" action="Article" >
<parameters>
<add name="id" value="0" constraint="\d{1,10}" />
<add name="page" value="1" constraint="\d{1,10}" />
</parameters>
</route>
<route name="TimeList" url="stage/list/{categID}/{propID}/{page}/{psize}" controller="Home" action="TimeList" >
<parameters>
<add name="categID" value="0" constraint="\d{1,10}" />
<add name="propID" value="0" constraint="\d{1,10}" />
<add name="page" value="1" constraint="\d{1,10}" />
<add name="psize" value="10" constraint="\d{1,10}" />
</parameters>
</route>
你好,
可以尝试把Article路由放在TimeList前面看看有没有起作用.~实在不行我在去翻在Web.config内配置路由的语法及注意事项做个Demo给你看看.
或者在TimeList的路由内把{page}, {psize} 这两个参数不要给value看看
<route name="TimeList" url="stage/list/{categID}/{propID}/{page}/{psize}" controller="Home" action="TimeList" >
<parameters>
<add name="categID" value="0" constraint="\d{1,10}" />
<add name="propID" value="0" constraint="\d{1,10}" />
<add name="page" constraint="\d{1,10}" />
<add name="psize" constraint="\d{1,10}" />
</parameters>
</route>
目前不太确定这个用法会被运行时通过!
@dotNetDR_:会报错的