ASP.NET MVC - Trouble passing model in Html.ActionLink routeValues

后端 未结 6 1465
北恋
北恋 2020-12-09 19:25

My View looks like this:

<%@ Control Language=\"C#\" 
    Inherits=\"System.Web.Mvc.ViewUserControl

        
6条回答
  •  不知归路
    2020-12-09 19:55

    One other option is to persist the data you need in TempData. This will hand it to the next request, and you can retrieve it there. You should be able to persist the entire model object if you want to.

    But it's easier (and better practice) to just retrieve it again from the database, as Darin suggests.

提交回复
热议问题