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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:19:57+00:00 2026-06-04T18:19:57+00:00

I am using this tutorial to serialise a C# dictionary. The C# dictionary gets

  • 0

I am using this tutorial to serialise a C# dictionary.
The C# dictionary gets serialized to a string.
The @Html.Raw(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(ElementDivIDs)) works like a charm. This is the output I get,:

  var jsonString = {"9":["ele9-tabs-attr9","ele9-tabs-attr48"],"10":["ele10-tabs-attr10"],"11":["ele11-tabs-attr11"],"12":["ele12-tabs-attr12","ele12-tabs-attr49"],"13":["ele13-tabs-attr13"],"14":["ele14-tabs-attr14"]}

I want to convert this into a Javascript associative array.
But the call to jquery.parseJSON returns NULL.

var dictionaryOfOtherDivs = jQuery.parseJSON( jsonString );

dictionaryOfOtherDivs is null after this.

Here’s my code:

<script type="text/javascript">
$(document).ready(function () {
     var jsonString = @Html.Raw(new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(ElementDivIDs))
     console.log(jsonString); 
     var dictionaryOfOtherDivs  = jQuery.parseJSON( jsonString ); 
     for(var dictKey in dictionaryOfOtherDivs)
     { 
        console.log("key = " + dictKey + ", value = " + dictionaryOfOtherDivs[dictKey]); 
     }
     //Do some more things
});
</script>
  • 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-04T18:20:00+00:00Added an answer on June 4, 2026 at 6:20 pm

    That’s not a JSON string; that’s an ordinary object literal.

    You don’t need to parse it.

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

Sidebar

Related Questions

Using this tutorial at section 5.5, I attempted to Assign the 'celsius' string attribute
hi friends i m using this tutorial http://xjaphx.wordpress.com/2012/02/04/android-xml-adventure-parsing-html-using-jsoup/ and after i implemented this code
I've been using this tutorial http://mpjexpress.blogspot.co.nz/2010/05/executing-and-debugging-mpj-express.html , text: steps 1,2,3 and video: steps between
Using this tutorial at this section 4.5 : http://www.vogella.de/articles/Android/article.html#first_uiproperties as a guide, I attempt
i'm trying to use C2DM client with this tutorial:http://www.vogella.de/articles/AndroidCloudToDeviceMessaging/article.html I'm using this code for
Using this tutorial: http://dotnetslackers.com/articles/ajax/Using-jQuery-with-ASP-NET.aspx The web service is invoked such as Service1.asmx/HelloToYou The default
To learn spring MVC im using this tutorial - http://static.springsource.org/docs/Spring-MVC-step-by-step/index.html It refers to spring2.5
I'm using this tutorial: http://android-developers.blogspot.com/2011/04/customizing-action-bar.html I set a drop down list theme like this
I wrote a code using this tutorial http://marakana.com/forums/android/examples/311.html It is working fine except the
I'm using this tutorial to get internal messages working on my site: http://www.novawave.net/public/rails_messaging_tutorial.html But,

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.