How to use two models in a single class?

 Posted by Kmandapalli on 2/4/2014 | Category: ASP.NET MVC Interview questions | Views: 2418 | Points: 40
Answer:

Whenever you want to use two models in a single view, then add the models to the view in the following way,

@using MvcSampleCFA_02032014.Models;
@model Tuple<PersonCFA, AddressCFA>

Now, you can access all the properties present in the two models.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response