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

问题描述

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

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

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

解决方法

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

return RedirectToAction("Index");