Sending more than one model to view MVC 4

后端 未结 3 887
一向
一向 2021-02-20 15:46

I have two model classes, each is a table in a database. One model is called \'Clothes\' and the other \'Shoes\'.

I want to display the contents of each table in the sa

3条回答
  •  暖寄归人
    2021-02-20 15:54

    I have found this article very interesting :

    https://workspaces.codeproject.com/user-10826818/using-multiple-models-in-a-view-in-asp-net-mvc-4

    It presents different ways to send multiple models to a view :

    • ViewData
    • ViewBag
    • PartialView
    • TempData
    • ViewModel
    • Tuple

提交回复
热议问题