MVC shared model different required fields on different type
- by kurasa
I have a model called Car and depending on what type of Car the user select the view is presented differently. For example the user selects from a grid of different cars and depending if it is a Volvo or a Kia or a Ford the view must allow different fields to be editable. For example with a Volvo the color is editable and is mandatory but with a Kia it is not.
I would like to use the one Car class to bind the view but want the client side validation to pick up the required fields based on what type of car.
I want to go only to one Action method for the Update
what is a good way to approach this problem...? create a base class and inherit from it? will this give me binding problems..?