Click here to Skip to main content
15,911,711 members

Comments by Member 14574143 (Top 13 by date)

Member 14574143 6-Mar-21 5:56am View    
one more thing please i am now trying to add export button to the table but i failed i tried all the solution on the internet



$(function () {
$.ajax({
type: "POST",
url: "daily.aspx/GetCustomers",
data: '{}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response.d);
},
error: function (response) {
alert(response.d);
}
});
});
function OnSuccess(response) {
$("[id*=GridView2]").DataTable(
{
"sScrollX": "100%",
"bScrollCollapse": true,
scrollY: "100%",
bLengthChange: true,
lengthMenu: [[5, 10,20, -1], [5, 10,20, "All"]],
bFilter: true,
bSort: true,
bPaginate: true,
data: response.d,
columns: [{ 'data': 'sitecode' },
{ 'data': 'siteid' },
{ 'data': 'region' }]
});
};
Member 14574143 5-Mar-21 10:46am View    
The problem was caused by the request timeout but not the size of the data. Since I was using ajax updatepanel in aspx project I added AsyncPostBackTimeOut='300000000' to my ToolkitScriptManager tag and added

<system.web.extensions>
<scripting>
<webservices>
<jsonserialization maxjsonlength="300000000">



to my Web.config file as documented here. Now I can load the data without any problem though it's taking some time depending with the number of records returned. Thanks for your help.
Member 14574143 5-Mar-21 10:23am View    
how could i do that please ?
Member 14574143 5-Mar-21 10:14am View    
ok could i do that please
Member 14574143 5-Mar-21 10:10am View    
so no solution ? i am really disappointed.