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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:21:47+00:00 2026-05-20T14:21:47+00:00

Following this post and the other posts that it links to, I have successfully

  • 0

Following this post and the other posts that it links to, I have successfully built a page with a variable legnth editable list.

Now, I need to do another page with similar functionality, but going a step further. Basically I need to create a variable length list of objects as I have already done, but in this case each object in the list needs to have its own variable length editable sub list.

I can build the view with no problem but I guess I am lost as to how I will handle this in my POST controller method to save the objects.

Will my controller take 2 IEnumerable parameters?
I.E.

public ActionResult SaveList(IEnumerable<MainList>, IEnumerable<Sublist>)
{

}

It seems like this would work but I have no way of associatiing the objects in the sublist collection with the appropriate object in the main list collection.

What am I missing?

  • 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-20T14:21:47+00:00Added an answer on May 20, 2026 at 2:21 pm

    Summing up the results of our comment-discussions as an answer:

    The sublists should be members of your MainList elements. In the View you will have a nested foreach loop to work with the Sublist elements. In the controller you just accept the MainList as a parameter (it should already have the sublists as members). In order for the ModelBinder to pick up the sublists correctly, the names of the inputs should include the names of main list first (and not just the properties inside the sublist item).

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

Sidebar

Related Questions

What could be the understanding of the following? I have gone through this post
By following this post I have reduced the size of my ViewState up to
This is tailing off my other question which was successfully answered: stackoverflow.com/questions/8597929/need-to-create-li-with-list-of-different-links-using-php-explode-method so now
I have looked at the following links, but nothing seems concrete. Secure HTTP Post
I have the following code that shows 5 posts each being the latest from
I've been following this post http://martinciu.com/2011/01/mounting-grape-api-inside-rails-application.html I put the module into the lib directory
I'm following the instructions on using xsi:type from this oft-cited blog post: http://blog.bdoughan.com/2010/11/jaxb-and-inheritance-using-xsitype.html Basically
Following this question and answer , I still have a bit trouble in the
Following this question, it seems that it is possible to open a file from
I have a site that enables users to post messages to a forum. At

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.