Form Demo - Add New Car

This example demonstrates processing a form using Strongly-Typed View that uses a Car Model object attached to the View. It also uses HTML tag helpers to help write the HTML for the page. This View uses two separate Controller methods to handle the processing of this page. The Controller contains two overloaded "AddCar" methods where one method is used to deliver the View for user input and the other is used to process the form. The Controller's "AddCar()" method is used to deliver this View to the client to gather user input for the new car. This Controller method passes a Car object used as the Model for the View. The View uses the Controller's "AddCar(Car)" method to process the HTML form. The form controls are bound to the public properties of the Car Model object. The form uses HTTP Post to submit the form data to the Controller's method.


Car Information:




Back to Home