无法重定向路由表中没有路由与提供的值匹配在MVC 5中

问题描述

无法重定向到某些页面,显示错误消息“路由表中的路由与提供的值不匹配。在MVC 5中”

// before
this.mapper.map(career,ResponseCareerDto,Career);

// after
await this.mapper.mapAsync(career,Career);

解决方法

您正在将路线属性值传递给RedirectToAction。相反,您需要ActionResult的名称,在本例中为Index。

return RedirectToAction("Index");

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...