ASP.NET MVC passing an ID in an ActionLink to the controller

前端 未结 5 1728
故里飘歌
故里飘歌 2020-12-07 20:03

I can\'t see to retrieve an ID I\'m sending in a html.ActionLink in my controller, here is what I\'m trying to do

  • <%= Html.ActionLink(\"Mod
  • 5条回答
    •  一向
      一向 (楼主)
      2020-12-07 20:17

      In MVC 4 you can link from one view to another controller passing the Id or Primary Key via

      @Html.ActionLink("Select", "Create", "StudentApplication", new { id=item.PersonId }, null) 
      

    提交回复
    热议问题