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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:08:20+00:00 2026-06-09T02:08:20+00:00

I have a complicated json structure. Here it is simplified because it happens with

  • 0

I have a complicated json structure. Here it is simplified because it happens with this too:

{
"Id":0,
"Name":"Region Challenge",
"ModifiedOn":"2011-09-08T17:49:22",
"State":"Published",
"Goals":[
        {"Id":1,"Description":"some text here","DisplayOrder":1},
        {"Id":2,"Description":"some text here","DisplayOrder":2}
    ]
}

So, when this data is POST’d to controller, I have no problem getting this values for Id, Name, etc. However, Goals is null when I look at the locals window.

The signature is:

public JsonResult Save(int Id, String Name, DateTime ModifiedOn, String State, String Goals)

The POST Headers are:

User-Agent: Fiddler
Host: localhost:2515
Content-Type: application/json
Content-Length: 7336

How do I read in the data so that I can iterate over it?

Thanks!
Eric

  • 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-09T02:08:21+00:00Added an answer on June 9, 2026 at 2:08 am

    Your Goals is a array or list. The simplest way is to

    1. Create a viewModel
    2. Change the ActionMethod

    Sample

    ViewModel

    public class SomeThing
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public DateTime ModifiedOn { get; set; }
        public string State { get; set; }
        public List<Goal> Goals { get; set; }
    }
    
    public class Goal
    {
        public int Id { get; set; }
        public string Description{ get; set; }
        public int DisplayOrder{ get; set; }
    }
    

    Changed ActionMethod

    public JsonResult Save(SomeThing model)
    {
       // model.Name ....
       // model.Id ...
       // model.Goals is your list of Goals
    
       // return Json
    }
    

    More Information

    • How to use the ASP.NET MVC ModelBinder
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a complicated structure of returned by an URL in JSON format, i
I have this complicated slider that utilizes tons of animation. I'm trying to find
I have a complicated example of converting a Javascript Array to a JSON String.
I have a complicated problem and I hope to explain it clearly possible... I
I have a complicated MySQL query which takes a lot of time, selecting from
I have a complicated report that I need to draw with GDI+ (I don't
I have some complicated, problem to be solved. Now I need to write such
I have a complicated problem, and I need help. I have a base case,
I have a complicated nested form (Ryan Bates' version) with .live() attached to some
I've got a program where a lot of classes have really complicated configuration requirements.

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.