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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:45:44+00:00 2026-05-12T17:45:44+00:00

Funny as it can sound, I transformed my datatable data into a string which

  • 0

Funny as it can sound, I transformed my datatable data into a string which looks something
like this:

 { blocks: [
{"fromAge" : "60","fromAmount" : "0","toAge" : "64","toAmount" : "65000","color" : "red","orderNo" : "2"}, 
{"fromAge" : "66","fromAmount" : "0","toAge" : "72","toAmount" : "12000","color" : "red","orderNo" : "4"}, 
{"fromAge" : "64","fromAmount" : "0","toAge" : "72","toAmount" : "34400","color" : "red","orderNo" : "1"}, 
{"fromAge" : "64","fromAmount" : "19500","toAge" : "66","toAmount" : "50750","color" : "red","orderNo" : "3"}
]}

with the ideea that “blocks” is something like an array with 4 dicitionaries, then with this action I return the string to the View:

public ActionResult ChartDetails()
{       
       return Json(GetJson(datatable));
}

GetJson(DataTable dt) is the method which returns the string, and in view I get this:

"{ blocks: [{\"fromAge\" : \"60\",\"fromAmount\" : \"0\",\"toAge\" : \"64\",\"toAmount\" : \"65000\",\"color\" : \"Color [Orange]\",\"orderNo\" : \"2\"}, {\"fromAge\" : \"66\",\"fromAmount\" : \"0\",\"toAge\" : \"72\",\"toAmount\" : \"12000\",\"color\" : \"Color [Green]\",\"orderNo\" : \"4\"}, {\"fromAge\" : \"64\",\"fromAmount\" : \"0\",\"toAge\" : \"72\",\"toAmount\" : \"34400\",\"color\" : \"Color [Blue]\",\"orderNo\" : \"1\"}, {\"fromAge\" : \"64\",\"fromAmount\" : \"19500\",\"toAge\" : \"66\",\"toAmount\" : \"50750\",\"color\" : \"Color [Pink]\",\"orderNo\" : \"3\"}]}"

And because of all the \” and “}” and ” I cannot read my Json with JQuery, is there some method to return a string with a normal encoding in my case?

  • 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-12T17:45:44+00:00Added an answer on May 12, 2026 at 5:45 pm

    The string you’re seeing is JSON, but properly encoded as a Javascript string. You still need to parse it in Javascript into objects to use it with jQuery.

    See the “official” JSON parser from json.org here: https://github.com/douglascrockford/JSON-js
    If you have that in your environment, you can do this:

    var jsonString = /* my string from the GetJson call */
    var data = JSON.parse(jsonString);
    

    And then you should be able to use “data” as a proper list of maps.

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

Sidebar

Related Questions

this may sound funny, but i spent hours trying to recreate a knob with
I'm a jstl newbie so probably this question will sound to you funny. Anyway,
I'm writing multilingual website. I have several files on server like: /index.php /files.php /funny.php
A lot of programming languages and frameworks do/allow/require something that I can't seem to
I find it funny that Java (or the java.util library) does not have a
I have some funny deadlock caused by a stupid simple SQL UPDATE query, on
I have always thought that the terms internationalization and localization (and their funny abbreviations
I'm looking for the coolest thing you can do in a few lines of
I've just recently started learning HTML/CSS and I've been trying to teach myself sound
I'm doing some funky authentication work (and yes, I know, open-id is awesome, 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.