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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:48:57+00:00 2026-06-04T05:48:57+00:00

I have an js file that appends data from webmethod to a gridview. My

  • 0

I have an js file that appends data from webmethod to a gridview. My problem is whenever I’m clicking again my button, it appends and added the new data with the previous data in the gridview. Is there a way to remove the last appended data and append a new one? Another question. In binding a gridview, I need to bind a datasoure upon loading of the page, in order to have it to display the data that I want to append. How can I remove that datasource that I binded when trying to append a new one? Sorry for the long and many questions. THANKS!

$.ajax({
   url: "Default.aspx/getDetails",
   data: Data,
   type: "POST",
   dataType: "json",
   contentType: "application/json; charset=utf-8",
   success: function (mydata) {
   for (var i = 0; i < mydata.d.length; i++) {
       $(".rpt").html("<table id=\"tbl\"><tr>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Date Joined</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Memberid</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Member ID</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>User ID</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Username</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Password</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Full Name</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>First Name</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Last Name</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Birth Date</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Address</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Location</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Sponsor ID</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Parent ID</th>" +
                         "<th style='background-color: #75a844' class='tbl_h'>Placement</th>" +
                         "</tr>");

            for (var i = 0; i < mydata.d.length; i++) {
                $("#tbl").append("<tr><td>" + mydata.d[i].datejoined +
                                                                   "</td><td>" + mydata.d[i].memid +
                                                                   "</td><td>" + mydata.d[i].memberid +
                                                                   "</td><td>" + mydata.d[i].userid +
                                                                   "</td><td>" + mydata.d[i].usrname +
                                                                   "</td><td>" + mydata.d[i].pssword +
                                                                   "</td><td>" + mydata.d[i].fullname +
                                                                   "</td><td>" + mydata.d[i].fname +
                                                                   "</td><td>" + mydata.d[i].mname +
                                                                   "</td><td>" + mydata.d[i].lname +
                                                                   "</td><td>" + mydata.d[i].bdate +
                                                                   "</td><td>" + mydata.d[i].address +
                                                                   "</td><td>" + mydata.d[i].location +
                                                                   "</td><td>" + mydata.d[i].sponsorid +
                                                                   "</td><td>" + mydata.d[i].parentid +
                                                                   "</td><td>" + mydata.d[i].placement + "</td></tr>");
            }
            $("#tbl").append("</table>");
        }
    });
  • 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-04T05:48:58+00:00Added an answer on June 4, 2026 at 5:48 am

    cacheBoolean
    Default: true, false for dataType ‘script’ and ‘jsonp’
    If set to false, it will force requested pages not to be cached by the browser. Setting cache to false also appends a query string parameter, “_=[TIMESTAMP]”, to the URL.

    cache : false,
    

    If your #Grid1D has no other elements inside you can also do:

    $("#Grid1D").html(
           // ...
    );
    

    instead of .append()

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

Sidebar

Related Questions

I have Text file that contains data separated with a comma , . How
So, I have this code that grabs a bunch of data from the database,
I have an unordered list that is being loaded from an external file using
I have a CSV file that was extracted from a ticketing system (I have
I have an app that is importing data from JSON and generating (through JQuery's
I have a number of functions that parse data from files, usually returning a
I have a class to import data from a CSV file, and a function
I have an existing XML file that I would like to append without changing
I have a file that contain huge number of net names. I would like
I have a file that I set using PowerShell that contains the version number

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.