MVC - Passing Data with RedirectToAction()

前端 未结 8 2110
既然无缘
既然无缘 2020-12-01 15:17

I\'d like to take data entered in an MVC user form and display it in a different view.

The class has the following private variable:

IList

        
8条回答
  •  伪装坚强ぢ
    2020-12-01 16:14

    The second parameter to RedirectAction is routeValues, not model.

    protected internal RedirectToRouteResult RedirectToAction(string actionName, object routeValues);
    

    Try using TempData for the model. Its for persisting data between redirects.

提交回复
热议问题