asp.net-mvc-5partial-viewsrazor-2

Can we have Multiple partial views with different models inside a single view?


Hi everyone am developing an application using ASP.NET MVC 5 and I want to display different models using partial views inside a single view is that possible or I have to make a model for the parent view that includes all the models of the partials ???


Solution

  • If i understood you want use more than one model per view and this is not possible. You need a object with others objects inside. (like you said a model to the parent view that includes all models of the partials).

    Your post maybe duplicated for this: MVC 5 Multiple Models in a Single View