I am using the following ViewModel to create an Employee
public class EmployeeViewModel
{
Employee employee{ get; set; }
Budget budget { get; set; }
}
How can I access the properties of Employee object inside my view? I would like to do something like
@Html.EditorFor(model => model.Employee.EmployeeID)
You start by having a controller action that will pass this model to the view:
then you have a corresponding view which is strongly typed to this model and in which you will be able to access the properties of this view model: