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

  • Home
  • SEARCH
  • 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 8300799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T16:41:21+00:00 2026-06-08T16:41:21+00:00

I am looking to populate my grid with JSON data. The data is in

  • 0

I am looking to populate my grid with JSON data. The data is in the below format:

[{
  "SiteId":"1",
  "SiteName":"University of Minessota",
  "SiteStatus":"Fully Operational"
},{
  "SiteId":"2",
  "SiteName":"MSP Airport-Humphrey",
  "SiteStatus":"Settlement Required"
},{
  "SiteId":"3",
  "SiteName":"City Of Minneapolis-Lot C",
  "SiteStatus":"Fully Operational"
},{
  "SiteId":"4",
  "SiteName":"TargetCenter",
  "SiteStatus":"Low Tickets"
},{
  "SiteId":"5",
  "SiteName":"Excel Energy Center",
  "SiteStatus":"Out Of Tickets"
}]

and i am passing this to the view using my controller method:

public JsonResult StatusReport()
{
    List<CenterStatus> status = MvcList.Models.CenterStatus.GetStatus();
    return this.Json(status, JsonRequestBehavior.AllowGet);
}

Now in my view I need to populate this JSON data into a grid:

$(document).ready(function () {
    $.ajax({
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "CenterStatus/StatusReport.aspx",
        data: "{}",
        dataType: "json",
        success: function (data) {
            for (var i = 0; i < data.d.length; i++) {
                $("#GridView1").append("<tr><td>" + data.d[i].siteID + "</td><td>" + data.d[i].siteName + "</td><td>" + data.d[i].siteStatus + "</td></tr>");    
            }
    },
    error: function (result) {
        alert("Error");
    }
});

But I have no luck in achieving my goal so far. Any suggestions?

  • 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-08T16:41:24+00:00Added an answer on June 8, 2026 at 4:41 pm

    Do it like this. do not call append in a loop. Set it to a variable and call the html function only once.

    success: function (data) {
                                var row=""
                                $.each(data,function(index,item){
                                    row+="<tr><td>"+item.SiteName+"</td></tr>";
                                });
                                $("#GridView1").html(row);
                           },
    

    Working sample : http://jsfiddle.net/x76LD/1/

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

Sidebar

Related Questions

I am looking for a way to populate a single grid using data bindings.
I am looking to populate a combo box with a Json file that is
We're looking to populate a number of tables for testing. The data can all
Looking for a way to do something like the following: NewtonSoft.Json.JsonConvert.Populate<IMyContract>(jsonStr, currentObj); where the
I am looking into using High Charts, but I want to populate the data
Looking to use the following data and populate the datetime in status table only
Hi can anyone help with a linq query, normally I populate my data grid
I'm looking to populate an array with bitmapdata based on some xml I load.
Hi I'm looking to populate a list of members, based on where their club
I'm looking for a way to populate more than 1 table in MVC, because

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.