Multiple Models in a View in ASP.NET MVC4/MVC5

As a beginner in ASP.NET MVC, the most common question is how to pass multiple models in a view. There are two common ways to achieve the same output. However, there are a lot of ways of using multiple models in a view, these are:

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

 

All the above  ways of using multiple models in view have their own place. However, we need to think which of these is right for our requirements. All these techniques have their own advantages and disadvantages.

To understand it better, download the attached code in the blog.

Read the rest of the post here: http://www.codeproject.com/Articles/687061/Using-Multiple-Models-in-a-View-in-ASP-NET-MVC-4-M

Leave a Reply

Your email address will not be published. Required fields are marked *