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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:32:03+00:00 2026-05-14T14:32:03+00:00

I have a c# object (below) that I’m trying to send to my javascript.

  • 0

I have a c# object (below) that I’m trying to send to my javascript.

My problem is, that while I can iterate over the items in the list, I can’t get to the string-property (‘Period’).

Referencing the object in JS shows no property at all. After Json-encoding in c#, I can still see the property just before returning it to caller (hovering over the result variable in below function):

[OutputCache(Duration = 0, VaryByParam = "None")]
public JsonResult GetRankingList() {
 Response.ContentType = "text/javascript";
 var user = _userService.GetUserByPrincipal(User);

 // Note, we do this while the user waits as we need to make progress in repeated calls to get the compared ranking list.
 _businessLogicServiceMaintenance.PerformMaintenanceSteps();

 //TODO: Replace with userid (Guid)
 var rankingList = _presenterService.GetRankingListForDisplay(user);

 if (rankingList == null)
  return Json("");

 var result = Json(rankingList);
 return result;
}

How on earth can I get past this? Any comments appreciated!

Yours, Anders, Denmark,

public class RankingListForDisplay : List<RankingListLine>
{
    public string Period { get; set; }
}
  • 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-14T14:32:03+00:00Added an answer on May 14, 2026 at 2:32 pm

    Thanks for taking your time – I found a solution.

    I changed above implementation of RankingListForDisplay to the one below. For some reason json likes it way better 😉

    public class RankingListForDisplay 
    {
        public List<RankingListLine> Lines { get; set; }
        public string Period { get; set; }
    
        public RankingListForDisplay()
        {
            Lines = new List<RankingListLine>();
            Period = "<Unspecified>";
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have JSON Object that looks something like the below object, this object can
I have an xml string below that I've turned into an object using $content
I have a Generic List object which hold below table as its own value.
I have a working JavaScript code below which dynamically creates JSON object using JSON.parse
I have an object that reads from a socket continuously like below: void CSocketReader::ReadComplete
I have created a Parcelable object below, my object contains a List of Products.
I have written such the code below that ; I have an array list
I have a very specific problem. I have a user control (code below) That
I have a class as shown below that stores a Uri object and also
I have an object that I want to send to another device via bluetooth.

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.