开发者

'The resource cannot be found' - error for 1 specific controller asp.net mvc

开发者 https://www.devze.com 2023-03-12 08:59 出处:网络
I\'ve been pulling my hair out on this one. I have a controller: ChatController of which any route I try gives me a \'The resource cannot be found\' error.

I've been pulling my hair out on this one.

I have a controller: ChatController of which any route I try gives me a 'The resource cannot be found' error.

The route:

   routes.MapRoute(
         "chatPage",
         "{lang}/chat/{action}",
         new { lang = "th", controller = "Chat", action = "Index" }
    );

The url: /th/chat

All my other routes (to other controllers) work fine.

I use routedebug.dll to see if my routes are set up correcty and the route is correct.

'The resource cannot be found' - error for 1 specific controller asp.net mvc

Even if I delete the whole ChatController, I still get the same error. That means it does find the route but doesn't even get to the controller (usually this will give an controller not found error or something similar)

I get this on development server and IIS.

Anyone?

* Update *

I got it working by changing the routevalue from {lang}/Chat to {lang}/chat and changed my controllername accordingly (ChatController => chatController), this works开发者_JS百科... for now. Still want to know what causes this.


make sure that previous routes don't match this case. comment all others routes and then try. in my computer it's works for me :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号