The default action gets 404 for only one page (asp.net mvc)

I only test my application on the local cassini web server and I get the weird thing.

One index page works correctly by default, the second shows 404, but when using the full version of Controller / Index, it works fine. The only difference that I found is that in the first example there is no slash in the end, and in the second slash exists, but the link that points to the damaged one does not have a slash.

+3
source share
3 answers

Can you show us your routes? Or even better: try using Phil Hack with an excellent (and necessary) Route Debugger. He will tell you which route falls on this request, or if the route did not fall at all.

http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx

Only works with the beta version of MVC, though if you are using any older MVC pre-release.

+5
source

Thanks for RouteDebug, the problem was that I named Controller by the name of one of the root directory, for example Models, Views, etc.

+6
source

if you can publish your routes, we could help you better, but for now I suggest you debug it using the "Routing Debugger" .

+4
source

All Articles