I've got a list of for example Vehicle's that I want to render in a single page, but have different view characteristics for each vehicle type.
Vehicle
- VehicleId
- VehicleTypeId (Car/Boat/Truck/etc...)
- Description
- ...
I'd like to on my main AllVehiclesPage
@foreach(var vehicle in Model) //where Model is a List<Vehicle> from AllVehicles
{
//Render proper View
//CarView(vehicle)
//BoatView(vehicle)
//TruckView(vehicle)
}
In each view it will render differently depending on the vehicle, IE Wheel rim size applies to cars/trucks not to boats etc...
I've read a number of the other questions on Stackoverflow about view inheritance, but they don't seem to apply.
Is this best to do with partial Views? Should I create Usercontrols?