Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
I use ajax jquery gridview to load a large amount of data..but the grid does not load..if less amount of data came the grid will display....otherwise it is not displayed...
So how to handle the large amount of data to display in ajax is my code...
// showing bill details
    function ShowBillDetails(control)
        var phoneNumber = $(control).attr('PhoneNumber').toString();
        setTimeout(function() { ShowBills(phoneNumber) },3000);
    return false;
// for show the data in grid
function ShowBills(phoneNumber) {
        type: "POST",
        contentType: "application/json; charset=utf-8",
        url: "LinkingCustomers.aspx/GetBillData",
        data: "{'phoneNumber':'" + phoneNumber + "'}",
        dataType: "json",
        success: function(data) {
        var theHtml = data.d;
        error: function(result) {
 #region WebMethods
        public static string GetBillData(string phoneNumber)
                GridView gv = new GridView();
                System.IO.StringWriter stringWriter = new System.IO.StringWriter();
                HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
                DataTable objDT = new DataTable();
                objDT = LinkingCustManager.GetBillData(phoneNumber);
                //var result = from n in objDT.AsEnumerable().Take(5) select n;
                gv.CssClass = "gridtable";
                gv.DataSource = objDT;
                return stringWriter.ToString();
Posted 22-Nov-13 19:00pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Mobile
Web03 | 2.8.141015.1 | Last Updated 23 Nov 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100