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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:24:36+00:00 2026-05-25T06:24:36+00:00

I have never worked on jquery but after some googling and learning I have

  • 0

I have never worked on jquery but after some googling and learning I have been able to use it in my application. I am trying to update a table row in my asp.net project but I am not able to update the table row by setting .html of it with the new data which I am receiving through a service.

I am prepopulating the table in the code behind so to generate the row and coloumns and also apply cssclass labels according to one of the ID. The ultimately render htmml of the table on the browser is as follows:

<table id="dataTable"> 
<tr class="Row1">   
<td>CC</td><td>0</td><td>0</td><td>0</td><td>1</td> 
</tr>
<tr class="Row2">   
<td>CC</td><td>0</td><td>0</td><td>0</td><td>2</td>   
</tr>
<tr class="Row3">   
<td>CC</td><td>0</td><td>0</td><td>0</td><td>3</td>   
</tr>  
</table> 

The code of my asp page through which I am trying to update the data row is as follows:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_Default" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head >
    <title>Simple AJAX Service Client Page</title>    
</head>
<body>
    <form id="form1" runat="server">
      <asp:Table ID="dataTable" runat="server" />         
    </form>

    <script type="text/javascript" src='<%= ResolveUrl("~/Scripts/jquery-1.4.1.js") %>' ></script>
    <script src="~/scripts/jquery-1.4.1.js" type="text/javascript"></script> 

     <script language="javascript" type="text/javascript">

         jQuery.ajaxSetup({
             // Disable caching of AJAX responses              
             cache: false         
         });


         $(document).ready(function () { setTimeout("countdown()", 1000); }); 

         function countdown() {

             $.getJSON("http://localhost:8732/Service/GetStat", null, function (result) {
                 for (var key = 0, size = result.length; key < size; key++) {

                    var htmlstr =
                    '<td>'
                    + result[key].Name
                    + '</td><td>'
                    + result[key].Size
                    + '</td><td>'
                    + result[key].Count
                    + '</td><td>'
                    + result[key].Handle
                    + '</td><td>'
                    + result[key].ID
                    + '</td>';

                    $('.Row' + result[key].ID).html = htmlstr //id values are like 1, 2, 3.....
                 }
             });

             setTimeout("countdown()", 1000);
         };     
    </script>

</body>
</html>

When I debug the code using Visual studio by putting the break point the value of the html that being formulated is in proper order (one of the sample value is as follows <td>CC</td><td>18444289</td><td>6</td><td>248</td><td>1</td>) and the variable value when debugging for (‘.Row’ + result[key].MonitorID) is like ROW1 and so on….

So why when setting the .html of this not working for me. Any help much appreciated.

Thank you.

  • 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-25T06:24:36+00:00Added an answer on May 25, 2026 at 6:24 am

    Try using .empty and .append , something like this:

    $('.Row' + result[key].ID).empty().append(htmlstr);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I might be an exception here but I have never worked on a team
I never worked with Silverlight before, but I have the requirement to build a
I have never worked on programming languages before. I am learning C and unix
I have never worked with json before. I am trying: http://api.worldbank.org//topics?format=JSON and make things
I have never worked with web services and rails, and obviously this is something
So I've never worked with stored procedures and have not a whole lot of
I have never used virtualization, and am trying to get up to speed. My
I have a basic cs-major understanding of multi-threading but have never had to do
I know you can return a javascript view but this has never worked for
I am java developer, (using Spring-MVC) never worked much on javascript, But I would

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.