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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:29:21+00:00 2026-06-11T06:29:21+00:00

My background is primarily PHP, so i’m used to being able to use deep

  • 0

My background is primarily PHP, so i’m used to being able to use deep arrays in forms very easily. What I need is the c#/MVC equivelant of the following:

<input type="text" name="data[0][index_name][0]">
<input type="text" name="data[0][index_name][1]">
<input type="text" name="data[1][index_name][0]">
<input type="text" name="data[1][index_name][1]">
<input type="text" name="data[2][index_name][0][something_else]">
<input type="text" name="data[2][index_name][0]">
<input type="text" name="data[2][index_name][1]">

These could then be accessed in this way in php…

$_POST['data'][0]['index_name'][0];
$_POST['data'][0]['index_name'][1];
$_POST['data'][1]['index_name'][0];
$_POST['data'][1]['index_name'][1];
$_POST['data'][2]['index_name'][0]['something_else'];
$_POST['data'][2]['index_name'][0];
$_POST['data'][2]['index_name'][1];

I’ve tried looking at/looping over the formColletion object i receive, but the keys are simply the name attribute string, such as “data[2][index_name][0][something_else],” and there is no depth to the data.

How do I parse this data and put in some usable data type? I do not know how deep the array will be as the form changes dynamically on the front end.

So you have some context, this will is being used to build a “table” of data that has a flexible number of rows and columns and each row can be treated as a standard row or grouping row (meaning it contains other rows), so the data can, in theory, get very deep.

On a side note, i’ve also thought about cleaning up the data on the client side, but it appears there’s nothing standard out there that supports this. Jquery.serialize and JQuery.serializeArray() do the same thing as C#/MVC and simply index everything with the full name attribute without taking into account the array indexes.

Thanks for any help!

  • 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-06-11T06:29:23+00:00Added an answer on June 11, 2026 at 6:29 am

    Model Binding turned out to be the correct solution. It support recursion out of the box. Here is a nice write-up:
    http://msdn.microsoft.com/en-us/magazine/hh781022.aspx

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

Sidebar

Related Questions

I primarily come from a PHP background but I have been asked to develop
I'm primarily from an ASP.Net background with some MVC. I've also done a little
Background: What I need to accomplish is to remove any records in a collection
Some Background: ASP.net MVC is primarly a paradigm shift in the way you structure
I am new to Objective C with a background primarily in database programming. I
before starting, just let my say that my background is primarily in graphic design,
Background: I'm fairly new to C# and currently working on a project intended primarily
I'm working on an ASP.NET MVC 3 application. I primarily come from a ASP.NET
I have found, and am trying to use, a plugin called stellar.js . Primarily
I'm relatively new to C# - but come from a C/C++ background. I need

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.