My task is to show multiple models
into a single view.I\'ve created a ViewModel
for my requirement but I\'m not meeting my requirement.
please have
In your controller, define your action method as follows.
public ActionResult ParentsDetails()
{
var studentDetails = new List();
var parentDetails = new List();
// Fill your lists here, and pass them to viewmodel constructor.
var viewModel = new ParentsInformationViewModel(studentDetails, parentDetails)
// Return your viewmodel to corresponding view.
return View(viewModel);
}
In your view define your model.
@model MySolution.ViewModels.ParentsInformationViewModel