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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:22:23+00:00 2026-05-27T07:22:23+00:00

I fill the treeview with an object that contains id and its value, so

  • 0

I fill the treeview with an object that contains id and its value, so it looks like this:

var serializer = new JavaScriptSerializer();
var rslt = serializer.Serialize(new {
        Id = node.Id.ToString(),
        impactLength = node.impactLenght.ToString()
        });
TreeNode newNode = new TreeNode(node.Name, rslt);

I”m having a problem getting its object back from href links of each node:

Here are some examples of hrefs:

1.Root

javascript:__doPostBack('ctl00$ContentPlaceHolder1$treeViewActions','s{\"Id\":\"0\",\"impactLength\":\"1\"}')

2.It’s Descendant

javascript:__doPostBack('ctl00$ContentPlaceHolder1$treeViewActions','s{\"Id\":\"0\",\"impactLength\":\"1\"}\\{\"Id\":\"2\",\"impactLength\":\"1\"}')

I successfully retrieve the href above and get only the object string part

{"Id":"0","impactLength":"1"}{"Id":"2","impactLength":"1"}{"Id":"7","impactLength":"1"} 

but when i try to parse it with jQuery.parseJSON, i get an exception:
“Uncaught SyntaxError: Unexpected token {“

What am i doing wrong?

thanks,
Eddie

  • 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-27T07:22:24+00:00Added an answer on May 27, 2026 at 7:22 am

    To process them all at once, you’d need to build them into the Array notation of JSON.

    '[{"Id":"0","impactLength":"1"},{"Id":"2","impactLength":"1"},{"Id":"7","impactLength":"1"}]'
    

    As it is, it isn’t valid JSON markup. You should really send the data from the server as proper JSON.


    If you can’t change it on the server side, then you could try this, but no guarantees:

       // assuming you have the part that you extracted stored in my_str...
    var my_str = '{"Id":"0","impactLength":"1"}{"Id":"2","impactLength":"1"}{"Id":"7","impactLength":"1"}'
    
       // ...try this
    var new_str = '[' + my_str.split( '}\\{' ).join( '},{' ) + ']';
    var result = jQuery.parseJSON( new_str );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like the TreeView below to expand to fill the current row that
I fill a form fields (in pygtk) from a class instance that contains its
I have a HeaderedContentControl that contains a TreeView. <HeaderedContentControl Header=Steps HorizontalAlignment=Stretch VerticalAlignment=Stretch> <TreeView Name=WizardSteps
How do I fill an array like this: array('0' => 'blabla','1' => 'blabla2') from
I have UserControl that holds Infragistics Graph control. On the TreeView sub node's right
I am overriding a TreeView so that I can highlight the nodes using better
This question refers to http://www.matthidinger.com/archive/2009/02/08/asp.net-mvc-recursive-treeview-helper.aspx Let's say I have a table that looks like
So i got this treeview where i want to display some people with as
function fill (colname) { var numRows, i, toCopy, iterated_name; numRows = document.getElementById('malesTable').rows.length + document.getElementById('femalesTable').rows.length
To fill one variable with a value from a query I can write following:

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.