This is all due to the encoded character "% 2f" corresponding to "/". Because of this, your url
customer/widget/contact_list/1-1004-SC-0-0-0-0-0-0-Supplier-Supplier--6%2f1%2f2013-7%2f6%2f2013--0-0-0-0-Year-Calendar-0-Home-0
It is divided into 8 segments:
- customer
- widget
- contact_list
- 1-1004-SC-0-0-0-0-0-0-0-supplier-supplier - 6
- 1
- 2013-7
- 6
- 2013--0-0-0-0-Year-calendar-0-Home-0
but on your route you expect 4.
To determine the number of variable segments, you can use an asterisk (*) as follows:
routes.MapRoute( "Customer_widget", "customer/widget/{action}/{*id}", new { controller = "Customer_Widget", id = UrlParameter.Optional });
The routing system checks the routes sequentially. Therefore, you need to be careful with this and define the route as low as possible, because it can catch a request that you do not want to catch using this route. For example, if the following route is defined on your system after the route above, it will never be snatched:
routes.MapRoute( "Customer_widget", "customer/widget/{action}/{lang}/{*id}", new { controller = "Customer_Widget", lang = "en", id = UrlParameter.Optional } new { lang = "en|es|ru"});
source share