//JSON -------------------------------- $(document).ready(function () { bindData(); }); function bindData() { $.ajax({ type: "POST", url: "MyTestForm.aspx/getData", data: "{}", contentType: "application/json;charset=utf-8", datatype: "jsondata", async: "true", success: function (response) { var msg = eval('(' + response.d + ')'); if ($('#tblResult').length != 0) { $("#tblResult").remove(); } var table = "<table class="tblResult" id="tblResult"><thead><table><tbody><tr><th>Name</th><th>Address</th><th>Age</th></tr></tbody></table></thead> <tbody>"; for (var i = 0; i <= (msg.length - 1) ; i++) { var row = "<tr>"; row += '<td>' + msg[i].Name + '</td>'; row += '<td>' + msg[i].Address + '</td>'; row += '<td>' + msg[i].Age + '</td>'; row += '</tr>'; table += row; } table += "</tbody></table>"; $('#divData').html(table); $('#divData').slideDown("slow"); }, error: function (response) { alert(response.status + ' ' + response.statusText); } }); } //C# --------------------------------------------------------- [WebMethod] public static string getData() { string data = string.Empty; try { using (MyTestDatabaseEntities context = new MyTestDatabaseEntities()) { var obj = (from r in context.MstNewTests select r).ToList(); JavaScriptSerializer serializer = new JavaScriptSerializer(); data = serializer.Serialize(obj); } return data; } catch { return data; } }
Quote:Not showing records more than 1427
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)