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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:04:54+00:00 2026-06-13T00:04:54+00:00

I want to do the following. Pass a complex json object in a hidden

  • 0

I want to do the following.

  1. Pass a complex json object in a hidden input variable
  2. Get that hidden variable through the form collection object.
  3. Convert that hidden text value to a dynamic object which I can loop through to
    get the data from it

So I think the first two items above I can do.

  1. $(“#hiddenVariableID”).val(JSON.stringify(data));
  2. Have a parameter called FormCollection collection in the MVC controller.
    Then get the value the following way String data =
    collection.Get(“hiddenVariableID”);
  3. ?? Not sure how to do this.

The data I’m passing is an array of objects. The objects are never the same so that is why I need to convert the results in some type of dynamic object that I can loop through.

I can’t do an ajax call to do this because I want to stream down the data passed in the hidden variable. So it has to be through a form submission.

Thank you,
-Tesh

  • 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-13T00:04:55+00:00Added an answer on June 13, 2026 at 12:04 am

    You can at that point use some JSON parser to convert between the string and a JSON object you can access dynamically. There are many JSON parsers out there, the code below shows how it can be done with two of them: the JavaScriptSerializer (part of the .NET Framework), and the JSON.NET (a non-MS library, but which IMO is really good).

    public static void Test()
    {
        string JSON = @"[
            {'name':'Scooby Doo', 'age':10},
            {'name':'Shaggy', 'age':18},
            {'name':'Daphne', 'age':19},
            {'name':'Fred', 'age':19},
            {'name':'Velma', 'age':20}
        ]".Replace('\'', '\"');
    
        Console.WriteLine("Using JavaScriptSerializer");
        JavaScriptSerializer jss = new JavaScriptSerializer();
        object[] o = jss.DeserializeObject(JSON) as object[];
        foreach (Dictionary<string, object> person in o)
        {
            Console.WriteLine("{0} - {1}", person["name"], person["age"]);
        }
    
        Console.WriteLine();
        Console.WriteLine("Using JSON.NET (Newtonsoft.Json) parser");
        JArray ja = JArray.Parse(JSON);
        foreach (var person in ja)
        {
            Console.WriteLine("{0} - {1}", person["name"].ToObject<string>(), person["age"].ToObject<int>());
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code and i want to pass additional parameter in JSON.getJSONfromURL() method
I want to pass tests which get the following: This test did not perform
I have the following scenario where I want to pass in string and a
I am using the following code.I want to pass property bgcolor as argument <!DOCTYPE
i want the following functionality. input : this is test <b> bold text </b>
I want to be able to do the following pseudocode: Pass in symbol a.
I want to store each Datatable Column in a string variable so that i
I want to make an application to execute several instructions to pass the following
I want to pass array and return array from a procedure, the following is
I want this: And I thought that passing na.action=na.pass to boxplot would let NA

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.