Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 481.6k

How to call two models on a View in asp.net mvc?

Jun 15 2020 3:23 AM
Hi Team
 
I
  1.   // Two model class here.  
  2.   
  3.     public class RoleViewAndFileViewModel  
  4.     {  
  5.         public RoleViewModel RoleViewModelData { getset; }  
  6.   
  7.         public FileViewModel FileViewModelData { getset; }  
  8.     }  
  9.   
  10.   
  11. // View class  
  12. @using eNtsaRegistrationTraining.Models  
  13. @RoleViewAndFileViewModel  
  14.   
  15. @{  
  16.     ViewBag.Ttile = "Dashboard";  
  17.     Layout = "~/Views/Shared/_HomeLayout.cshtml";  
  18. }  
have two models and i am using them both, but how do i call them at once on my view.cshtml? 

Answers (1)