我试图实现路由有问题,如下列:与MVC路由
帖子/ 535434 /这 - 是 - 一 - 后标题
posts/tagged/tags+here
// Matches {controller}/{action}/{id} - Default
// Displays all posts with the specified tags
// uses PostsController : ActionTagged(string tags)
posts?pageSize=50&pageIndex=4
// Matches {controller}/{action}/{id} - Default
// Displays all posts
// uses PostsController : Index(int? pageSize, int? pageIndex)
这是我想的问题这样做:
posts/39423/this-is-a-post-title-here
// Typically this is implemented using an action like 'Details'
// and would normally look like : posts/details/5
我似乎无法得到路由工作的权利。我想是这样的:
{controller}/{id}/{description}
并设置默认操作为“显示”的作品,但后来也不会允许我导航到像“标记”等命名的动作。
我错过了什么?
谢谢!
好的答案。虽然问题。我需要在IRouteContraint中做些什么?我从来没有用过它,你能否再解释一下。 – Micah 2009-02-06 13:06:10