Here is my situation:
Im currently making a website where it has to be possible to make a booking for renting a car.
My Index view contains the customer data and my partialview contains the car data. The Index view and the partial view makes use of two different models.
How do i make a httppost so i can create the correct booking with the data of both the customer and the car?
Here is my situation: Im currently making a website where it has to be
Share
Probably the easiest way is to create a ViewModel containing both the Customer data and the car data.
Something like:
Your HttpPost method will then accept that:
You may need some custom model binding going on as well. But the ViewModel should probably be your first step.