Show Multiple models data in one view [duplicate]












0
















This question already has an answer here:




  • Multiple models in a view

    10 answers




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();
}









share|improve this question















marked as duplicate by user3559349 Nov 24 '18 at 7:39


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    0
















    This question already has an answer here:




    • Multiple models in a view

      10 answers




    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();
    }









    share|improve this question















    marked as duplicate by user3559349 Nov 24 '18 at 7:39


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      0












      0








      0









      This question already has an answer here:




      • Multiple models in a view

        10 answers




      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();
      }









      share|improve this question

















      This question already has an answer here:




      • Multiple models in a view

        10 answers




      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();
      }




      This question already has an answer here:




      • Multiple models in a view

        10 answers








      html razor model-view-controller view model






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 23 '18 at 13:31









      Mohammadreza Farahani

      2,06131424




      2,06131424










      asked Nov 23 '18 at 12:53









      hira shahhira shah

      83




      83




      marked as duplicate by user3559349 Nov 24 '18 at 7:39


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by user3559349 Nov 24 '18 at 7:39


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


























          1 Answer
          1






          active

          oldest

          votes


















          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;}
          }





          share|improve this answer






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            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;}
            }





            share|improve this answer




























              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;}
              }





              share|improve this answer


























                2












                2








                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;}
                }





                share|improve this answer













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



                public class customViewModel{
                {
                public productViewModel productViewModel {get; set;}
                public BcaseViewModel BcaseViewModel {get; set;}
                }






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 23 '18 at 16:58









                vahidvahid

                1364




                1364















                    Popular posts from this blog

                    404 Error Contact Form 7 ajax form submitting

                    How to know if a Active Directory user can login interactively

                    Refactoring coordinates for Minecraft Pi buildings written in Python