0

When calling Html.Action with a specific controller and action I'm getting a "No route in the route table matches the supplied values". Is it possible to get the actual route that wasn't matched?

fsl
  • 831
  • 1
  • 11
  • 24

2 Answers2

4

I would recommend that you take a look at the Route Debugger tool (MVC 3/.NET 4) that you can get from NuGet. This should provide the relevant diagnostics that you would/will need to see what was generated and what routes were matched/why none were matched.

For previous versions, take a look at the Phil Haack tool that was created for Route Debugging.

Tommy
  • 39,592
  • 10
  • 90
  • 121
  • As I understand it, the route debugger lets me test urls against routes, to see which urls match which routes. Thats strictly speaking not what I'm looking for.. :) – fsl Aug 15 '12 at 21:09
  • Well...based on your question, if no route matched the supplied values, that means none of them matched, not just one did not match. The routing engine will start at the top of the list and go through the entire route table until it finds a match. If no match is found, you get the error you got. – Tommy Aug 15 '12 at 21:48
  • In your phrasing, its the 'supplied values' + e.g. an area segment, I'm looking for. – fsl Aug 16 '12 at 08:03
0

Had the same issue, solved it with the help of this post:

https://eliasbland.wordpress.com/2010/04/06/error-no-route-in-the-route-table-matches-the-supplied-values-when-using-html-action-or-html-renderaction-in-asp-net-mvc/

TL;DR;

There needs to be a default route handler mapping controller and action values for Html.Action and Html.RenderAction methods to work.

Community
  • 1
  • 1
hofnarwillie
  • 3,563
  • 10
  • 49
  • 73