RedirectToAction Causes “No route in the route table matches the supplied values” in ASP.NET MVC 3

后端 未结 6 1234
春和景丽
春和景丽 2021-02-19 08:41

I have a project that I recently upgraded to ASP.NET MVC 3. On my local machine, everything works fine. When I deploy to the server, I get an error anytime I use a Redirec

6条回答
  •  情书的邮戳
    2021-02-19 09:06

    There's a difference with trailing slashes in routes not working with MVC 3.0. MVC 2.0 doesn't have a problem with them. I.e., if you change the following:

    "{controller}.mvc/{action}/{id}/"
    

    to:

    "{controller}.mvc/{action}/{id}"
    

    it should fix this (from this thread, worked for me). Even when you use the upgrade wizard to move to MVC 3.0, this still throws InvalidOperationException. I'm not aware whether this is what Schmalls was talking about though.

提交回复
热议问题