切换到{controller} / {id} / {action}会中断Redirec

时间:2019-06-17 05:00:08

标签: asp.net-mvc

我要删除我的问题

现在生成/ Customer / Approve?id = 23,而不是/ Customer / 23 / Approve。

我可以直接指定〜/ Customer / 23 / Approve之类的,而不是使用and,而是宁愿使用。提供的功能。

2 个答案:

答案 0 :(得分:0)

尝试在routedata中添加没有ID的路由。

答案 1 :(得分:0)

只有您的控制器具有该Action的get方法时,您的代码才不会出现问题。 或检查您的routedata是否具有带有可选id作为参数的路由。

相关问题