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

  • Home
  • SEARCH
  • 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 637055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:34:57+00:00 2026-05-13T20:34:57+00:00

I tried numerous times over the last few weeks to get a server side

  • 0

I tried numerous times over the last few weeks to get a server side MVC 2 view to work with objects with nested IList elements without much success. I am missing some fundamental understanding that I hope this question resolves.

What I want is a form that shows a list of product where you can change information in-line, including a hierarchy (a list of product that each has a list of sub-products, that each has a list of images, etc.) I am trying to recreate an older MS Access form where the big form has a list of products and sub-forms show the related products, all allowing in-line edits. Access saves each record upon focusing on a different record.

Say you have a Domain Model that looks like this:

public class Product {
    ... // Lots of fields like public string name {get; set;}
    public IList<Department> departments {get; set;}
    public IList<SubProduct> subProducts {get; set;}
}
public class SubProduct {
    ... // Lots of fields like public string name {get; set;}
    public IList<Image> images {get; set;}
}
public class Image {
    ... // Lots of fields like public string name {get; set;}
}

And a view Model that looks like this:

public class EditProduct {
    IList<Product> products {get; set;}
}

In the MVC 2 View, how would you code the Edit fields so that you can post the single model back to the controller? I am familiar with the

<input id="products[0].subProducts[0].images[0].name" /... >

mechanic, but each IList needs a way to CRUD elements on the same screen. It’s a big data entry screen where speed counts as much as being able to see all products in a list. I need Add buttons, Delete buttons, and a means to post the entire form after editing any inputs.

If I look at it from a JQuery point of view:

  • I serialize the Model as JSON for the initial form for the first N number of IList elements
  • I load on the fly additional products in the same list when they reach the bottom of the container div
  • I accept the entire Model upon save/post or accept pieces of the same form for individual entities, like having a separate html form tag for each IList element

But for some reason, I am just not getting how to do this at the server side. Any links or example code for the View itself would be great. Elements without IList seems to work great, especially with UI templates. Would I create a bunch of individual html form tags around each editable entity and have posts only deal with one element at a time?

  • 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-13T20:34:57+00:00Added an answer on May 13, 2026 at 8:34 pm
    <% for (int count = 0; count < Model.Students.Count; count++ )
       {                                              %><%= 
          Html.EditorFor(m => m.Students[count])      %><%
       } 
    %>
    

    Creates form names like:

    name="Students[0].Name"
    name="Students[1].Name"
    name="Students[2].Name"
    

    Which bind back to the original List view model

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

Sidebar

Related Questions

Tried a bunch of things but I can't get it to work consistently amid
I've tried working with swing (for the first time) a few weeks ago and
I've tried numerous ways to get IE8 to reload a page but failed. IE
Last night and tonight I tried a few different approaches and came up with
I have created an fbml application. I have tried numerous examples of fbjs but
I have more than one OpenID as I have tried out numerous. As people
Please forgive if this question has been asked numerous times. I recently installed Eclipse
I've used the Export Template feature numerous times for C#, ASP.NET, WinForms, etc. projects.
So I want to get PHUnit up so I can run selenium server, but
I'm trying to do something i've done numerous times. I can't figure out why

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.