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 184763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:20:59+00:00 2026-05-11T15:20:59+00:00

Does anyone know of any examples or tutorials of an MVC view that shows

  • 0

Does anyone know of any examples or tutorials of an MVC view that shows parent/child data all on one form, and allows all the child records to be editable?

For example, say I have a table of people and another containing the vehicles they own. One one form, I want to show every vehicle for a given person, and make the data elements editable (i.e. license plate number, car color, etc.) in case there are mistakes. I don’t want to jump to a separate edit form for each vehicle.

My attempts thus far have gotten me to the point where I can display the data, but I can’t get it to post back to the controller. I’ve tried to narrow down the problem as far as I could here, but I’m still not getting it, and I think a broader example may be in order. Any ideas?

  • 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. 2026-05-11T15:21:00+00:00Added an answer on May 11, 2026 at 3:21 pm

    You can try something like this.

    Suppose you have this object :

    public class Vehicle {     public int VehicleID { get; set; }     public string LicencePlate { get; set; }     public string Color { get; set; } } 

    And this is your controller action that you’ll use to edit vehicle details (where you’ll post the form) :

    [AcceptVerbs(HttpVerbs.Post)] public ActionResult EditVehicles(int Owner, Vehicle[] vehicles) {     //manipulate the data, then return back to the list     return RedirectToAction('YourAction'); } 

    Then you should set your form this way :

    <!--have a form for each person, listing their vehicles--> <form action='/EditVehicles' method='post'>     <input type='hidden' name='Owner' value='25' />     <input type='hidden' name='Vehicles[0].VehicleID' value='10' />     <input type='text' name='Vehicles[0].LicencePlate' value='111-111' />     <input type='text' name='Vehicles[0].Color' value='Red' />     <input type='hidden' name='Vehicles[1].VehicleID' value='20' />     <input type='text' name='Vehicles[1].LicencePlate' value='222-222' />     <input type='text' name='Vehicles[1].Color' value='Blue' />     <input type='submit' value='Edit' /> </form> 

    This will help the DefaultModelBinder to correctly bind the form data to your model in your controller. Thus Response.Write(vehicles[1].Color); on your controller, will print ‘Blue’.

    This is a very simple example, but I’m sure you get the idea. For more examples about binding forms to arrays, lists, collections, dictionaries, take a look at here.

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

Sidebar

Related Questions

Does anyone know of any resources, examples or tutorials about testing ember.js apps ?
Does anyone know of any good examples of usage of HTML5 elements that are
Does anyone know any jquery script examples to show a full page/content website that
Does anyone know any site or book that presents problems like python challenge ,
does anyone know any sort of app that lets users visit a page on
Does anyone know of any simple, concise tutorials for packaging DotNetNuke modules for DotNetNuke
Does anyone know any source of examples and templates for software requirements, build environment
Does anyone know any free accessible clusters that are open to public and that
Does anyone know of any good tutorials/articles which give a broad overview of QT?
Does anyone know, or know of any examples of how to write a proram

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.