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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:36:02+00:00 2026-05-13T16:36:02+00:00

I am following this link to build a Client side repeater. According to the

  • 0

I am following this link to build a Client side repeater.

According to the above link to retrive the value from a Json key-value pair we can use result[i].property,for example

for (var post in msg)
{     
    var x= msg[post].Date;
    alert(x);
}

Here x returns the date from Json string. When I am trying to use the same with my data, it always returns as undefined. I tried to pop up an alert(msg.d) that shows a nice Json string with all my data. But when I try msg[post].Date(property name) it’s always returning undefined.

Please help..

Thanks in advance.

Update:

From the backend I am returning a generic list and then converting it into Json using the following code.

public static string ConvertToJSON(this object obj)
{

    DataContractJsonSerializer serializer = new DataContractJsonSerializer(obj.GetType());    

    MemoryStream ms = new MemoryStream();
    serializer.WriteObject(ms, obj);
    string jsonobj = Encoding.Default.GetString(ms.ToArray());
    ms.Dispose();
    return jsonobj;
}

then I am appending the returned Json to a stringbuilder and returning it to the Jquery ajax method.The returned Json looks like a string , not an object and hence I am unable to get any value from Json key value pair..

  • 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-13T16:36:02+00:00Added an answer on May 13, 2026 at 4:36 pm

    Update:

    It sounds like you’re doubly serializing the data on the server-side, returning a JSON string that gets serialized as JSON itself. When that reaches the client-side and jQuery deserializes the first layer of JSON automatically, you’re still left with the JSON string you manually built.

    You should return the List<T> as the return value of your service method and let the framework handle JSON serialization.

    Original Answer:

    Assuming the object is still contained in ASP.NET AJAX’s “.d” wrapper, as you implied:

    for (var post in msg.d) {     
      var x = msg.d[post].Date;
    
      alert(x);
    }
    

    Or, a traditional loop, which might be more straightforward:

    for (var i = 0; i < msg.d.length; i++) {
      var x = msg.d[i].Date;
    
      alert(x);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

following this link i was able to load and read pixels from a .gif.
Based from this link: How to build a jQuery dialog for confirmation (yes/no) that
I am trying to build a friendship system sorta following this link: How to
I am following all steps using this link . The build was successful but
I am trying to model this relationship following this link http://www.javaworld.com/javaworld/jw-01-2008/images/datamodel.gif Its the usual
I have created a static library following this link . But I am facing
Following the advice in this link, Eclipse, classpath and subversion , I have setup
I have tried to do this refering to following link. http://skypher.com/index.php/2008/07/28/function-list-for-php/ But no success.
I have the following bit of code, simply: $(function() { $('a.add-photos-link').live('click', function(e) { $(this).colorbox({
Specifically: what library is MockObjectTestCase in? I'm following this link: http://therning.org/niklas/2005/05/jmock-solid-testing/ Is there an

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.