ASP.Net MVC RouteData and arrays

后端 未结 6 1782
遥遥无期
遥遥无期 2020-12-03 01:35

If I have an Action like this:

public ActionResult DoStuff(List stuff)
{
   ...
   ViewData[\"stuff\"] = stuff;
   ...
   return View();
}
         


        
6条回答
  •  醉酒成梦
    2020-12-03 02:06

    I'm not at my workstation, but how about something like:

    <%= Html.ActionLink("click here", "DoMoreStuff", "MoreStuffController", new { stuff = (List)ViewData["stuff"] }, null) %>
    

    or the typed:

    <%= Html.ActionLink("click here", "DoMoreStuff", "MoreStuffController", new { stuff = (List)ViewData.Model.Stuff }, null) %>
    

提交回复
热议问题