How can i send two Model from controller to view using same action
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Let’s assume your two models are instances of MyModel and MyOtherModel.
I can think of two options:
Option 1 is really not your ideal solution. Since your model should relate to your view (that’s why I prefer the name ViewModel), I’d really go for option 2.
Option 2 would look like this: