MVC 路由 - 为什么我的请求与路由不匹配?
我正在提出一个我认为会被我的路线捕获的请求,但没有匹配项。我做错了什么?
任何意见表示赞赏, 安德斯,丹麦
-
网址:
EventReponse/ComingAdmin/386/01e71c45-cb67-4711-a51f-df5fcb54bb8b
预期比赛:
routes.MapRoute(
"Editing event responses for other user", // Route name
"EventResponse/{action}/{eventId}/{userId}", // URL with parameters
new {controller = "EventResponse", action = "ComingAdmin"} // Parameter defaults
);
所需的控制器(但我猜这不会发挥作用):
public class EventResponseController : ControllerBase
{
(...)
public ActionResult ComingAdmin(int eventId, Guid userId)
{
return RegisterEventResponse(eventId, AttendanceStatus.Coming, userId);
}
}
I'm making a request that I thought would be caught by my route, but there is no match. What am I doing wrong?
Any comments appreciated,
Anders, Denmark
--
Url :
EventReponse/ComingAdmin/386/01e71c45-cb67-4711-a51f-df5fcb54bb8b
Expected match:
routes.MapRoute(
"Editing event responses for other user", // Route name
"EventResponse/{action}/{eventId}/{userId}", // URL with parameters
new {controller = "EventResponse", action = "ComingAdmin"} // Parameter defaults
);
Desired controller (but I guess this does not come into play):
public class EventResponseController : ControllerBase
{
(...)
public ActionResult ComingAdmin(int eventId, Guid userId)
{
return RegisterEventResponse(eventId, AttendanceStatus.Coming, userId);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 userId 不在大括号之间
并且您的 Url 提到了 EventReponse 而不是 EventRe s ponse,因此应该是:
一切都在细节中:-)
Your userId is not between curly braces
And your Url mentions EventReponse instead of EventRe s ponse so it should be:
It's all in the details :-)