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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:24:07+00:00 2026-06-07T00:24:07+00:00

I have a problem with Json formating returned from .ASMX I need to return

  • 0

I have a problem with Json formating returned from .ASMX

I need to return something like this

[{ name : "TEST1", data : [100]},
{ name : "TEST2", data : [200]}]

so here’s my sample

 [WebMethod]
    [ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
    public List<jsonGraphSeries> Graph(string ID)
    {
       List<GenList>objGenList = new List<GenList>();
       GenList objlist;

       objlist = new GenList();
       objList.name = "TEST";
       objList.data[0] = 100;
       objGenList.add(objList);
     }



public class GenList
{
 public string name;
 public double[] data;
}

and nothing happens… can someone help me with this?

  • 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-07T00:24:08+00:00Added an answer on June 7, 2026 at 12:24 am

    silly me… in order for the json to recognize it as an array field…

    instead of doing this…

    objList.data[0] = 100;
    

    I should’ve done it like this…

     objlist = new GenList();
     objList.name = "TEST";
     objList.data = new [] {100};
     objGenList.add(objList);
    

    the output would be

    { name : "TEST1", data : [100]}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with deserializing JSON data from an external REST service. Depending
I have this little problem with json. //real json var json1 = {test1:TEST1,test2:TEST2,test3:TEST3,test4:TEST4}; alert(json.test1);
I want to display place details from this json: I have problem with parse
I have a problem accessing JSON data. I'm new to JSON and jquery so
I have a problem in binding JSON data to KENDO Pie Chart. I have
I Have two problem in this Case : I want to pass a JSON
I have a problem mapping a Json object recieved from the server into a
Json Problem : I have this formatted JSON { Table1:[ { TableName:LoadDistributor, Description:Distributor ,
I have a problem regarding a JSON string grabbed from WordPress custom post meta.
Well I have a problem reading the JSON data in jQuery, which is outputted

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.