0

My project is based on Asp.net Mvc i have facing the issue to show multiple model data in one view but didn't show in list or grid view it should be show in Form View style i have two modals class Product , BusinessCase

public class productViewModel
{
    public string ProductTitle { get; set; }

    public string Purpose { get; set; }

    public string Composition { get; set; }

    public string Requirment { get; set; }
}

business case viewModel

public class BcaseViewModel
{
    public string ExecutiveSummary { get; set; }
    public string Reason { get; set; }
    public string ExpectedBenefits { get; set; }
    public string DisBenefits { get; set; }
    public string Cost { get; set; }
    public string MajorRisks { get; set; }
}

I want to show these two view model data in one view that is

public ActionResult PBView()
{
    return View();
}
M Reza
  • 18,350
  • 14
  • 66
  • 71
hira shah
  • 23
  • 1
  • 4

1 Answers1

2

Create a new ViewModel that contains your ViewModels and use it.

public class customViewModel{
{
    public productViewModel productViewModel {get; set;}
    public BcaseViewModel BcaseViewModel {get; set;}
}
vahid
  • 258
  • 2
  • 8