function FillGrid() {
debugger;
var options;
var data = { };
var json_data = JSON.stringify(data);
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: "D2-1-1main.aspx/FillGridView",
data: json_data,
dataType: "json",
success: function (data) {
$("[id*=dlCustomers]").attr("border", "1");
var row = $("[id*=dlCustomers] tr:last-child").clone(true);
$("[id*=dlCustomers] tr:last-child").remove();
$.each(data.d, function (key, value) {
var customer = $(this);
$(".CustomerID", row).html(value.CustomerID);
$(".ContactName", row).html(value.ContactName);
$(".City", row).html(value.City);
$("[id*=dlCustomers]").append(row);
row = $("[id*=dlCustomers] tr:last-child").clone(true);
alert(row);
});
},
error: function (jqXHR, exception) {
alert(jqXHR.responseText);
}
});
return false;
}
<asp:DataList ID="dlCustomers" runat="server" RepeatLayout="Table" BorderStyle="Solid" Width="99%" ForeColor="#000000"
BackColor="#ffffff"
CellPadding="3"
GridLines="none">
<ItemStyle Font-Names="tahoma,arial,sans-serif"
Font-Size="12"
BackColor="#ffffff" />
<AlternatingItemStyle Font-Names="tahoma,arial,sans-serif"
Font-Size="2"
BackColor="#ffff00" />
<ItemTemplate>
Customer Name:
<asp:Label ID="ContactName" CssClass="ContactName" runat="server" Text='<%# Eval("ContactName") %>'></asp:Label><br />
Customer ID:
<asp:Label ID="CustomerID" CssClass="CustomerID" runat="server" Text='<%# Eval("CustomerID") %>'></asp:Label>
City:
<asp:Label ID="Version" runat="server" CssClass="City" Text='<%# Eval("City")%>'></asp:Label>
</ItemTemplate>
</asp:DataList>
<System.Web.Services.WebMethod(EnableSession:=True)> _
Public Shared Function FillGridView() As Customersinfo()
Dim dt As New DataTable()
Dim objDll = New Clscust()
Dim details As New List(Of Customersinfo)()
Try
details = objDll.GetCustInfo()
Catch ex As Exception
End Try
Return details.ToArray()
End Function
above code fill only two record
i'm not able to get the exact error
i'm getting 6 Records for details.ToArray() then it show Error after two records in jquery:ajax function