In the previous post we
saw on how to create a Model class,
in this post we will use the model class in the controller to populate the
model properties and pass on a list of Model objects to the view layer to
display the data in the view.
In the controller we will instantiate the model class set values to its properties and bind it with the view to display the data. Next let us edit the Home controller and initialize the model object as follows.
In the controller we will instantiate the model class set values to its properties and bind it with the view to display the data. Next let us edit the Home controller and initialize the model object as follows.