自定义路线图
您好,我必须将包含旧 Web 表单的旧路径路由到我的新控制器。
我尝试了以下方法:
routes.MapRoute(
"DownloadLink",
"products/pippo/download/{*catchall}",
new { controller = "Downloads", action = "Index"}
);
使用 http://mysite.com/products/pippo/download/ 调用我的控制器 但我收到的是 404 状态代码,我做错了什么?
提前致谢
Hi I have to route an old path, that was containing the old webform, to my new controller.
I tried this:
routes.MapRoute(
"DownloadLink",
"products/pippo/download/{*catchall}",
new { controller = "Downloads", action = "Index"}
);
To have my controller called with http://mysite.com/products/pippo/download/ but what I receive it's a 404 Status Code, what am I doing wrong?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
DownloadLink
路由注册放在 Global.asaxRegisterRoutes
方法中的所有其他路由注册之前。Put the
DownloadLink
route registration before all the other routes registrations in your Global.asaxRegisterRoutes
method.