Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7428211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:42:30+00:00 2026-05-29T08:42:30+00:00

Here is my situation: Im currently making a website where it has to be

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:42:32+00:00Added an answer on May 29, 2026 at 8:42 am

    Probably the easiest way is to create a ViewModel containing both the Customer data and the car data.

    Something like:

    class RentalViewModel
    {
      public Car Car { get; set; }
      public Customer Customer { get; set; }
    }
    

    Your HttpPost method will then accept that:

    class RentalsController
    {
      [HttpPost]
      public Create(RentalViewModel model)
      {
        //abbreviated
        SaveLogic.SaveCar(model.Car);
        SaveLogic.SaveCustomer(model.Customer);
      }
    }
    

    You may need some custom model binding going on as well. But the ViewModel should probably be your first step.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the situation. Multi-million user website. Each user's page has a message section. Anyone
Here's the situation I'm in: We have a field in our database that contains
Having trouble finding a solution for my situation here. Sorry if this has been
Here is the situation: PRODUCTION SERVER Website A (/home/a/www) Website B (/home/b/www) Website C
Not even sure I'm stating the question correctly. Here's the situation. I have a
Here the Situation . I am having 2 million records in table . Just
I have a very common situation here. And for years I haven't found if
Here's the situation: I have a label's text set, immediately followed by a response.redirect()
Here's the situation: I am trying to launch an application, but the location of
Here's the situation. I have a webservice (C# 2.0), which consists of (mainly) a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.