Sneha Dhandapani

Sneha Dhandapani

  • 1.5k
  • 471
  • 137.1k

How to access different model properties in same view inMVC4

Apr 3 2016 8:36 AM
Hi Is it possible to access the different model properties for same view
My VisitorsViewModel model
public DateTime FromDate { get; set; }
public DateTime ToDate { get; set; }
My View_VisitorsForm Model 
public System.Guid VisitingID { get; set; }
public string Employee { get; set; }
public string CustomerName { get; set; }
public Nullable<System.DateTime> VisitingDate { get; set; }
public string StartTime { get; set; }
public string EndTime { get; set; }
public string SpendTime { get; set; }
public string POVisit { get; set; }

I want to create 5 fields in view FromDate,Todate,CustomerName,Povisit ,StartTime,EndTimeEmployee. But all these fields properties in different models. Is it possible to access two different model properties in same view? i tried to explain my issue as per my level best. please any one give me solution.

Advance thanks..


Answers (3)