Ambiguous Actions

旧城冷巷雨未停 提交于 2019-12-07 02:21:29

You need to give the request routing mechanism enough information to be able to pick which one applies non-ambiguously, e.g., by supplying a regex pattern in the route registration and having that filter some of the requests into another action which you'd call ListByDate.

But in general if stuff starts getting confusing to program , ti'll be confusing to use:- http://odetocode.com/Blogs/scott/archive/2010/01/25/kiss-your-asp-net-mvc-routes.aspx

So another approach which avoids having to concoct regexes to disambiguate the date vs 'everything else' actions via a regex is to have a routing scheme:-

  • /by-date/yy-mm-dd
  • /by-key/key

Since you don't have the AcceptVerbs set it can't figure out which method to call. Can you clarify "it doesn't seem to work for me in other places"?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!