PDA

View Full Version : مشکل کار با Jquery DataTables



masoud.try
چهارشنبه 31 تیر 1394, 12:16 عصر
سلام من از پلاگین جی کوئری DataTables دارم استفاده میکنم ولی با مشکل بر خوردم.اینم کد و خطام .ممنون میشم کمک کنید.
[WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public static string GetU()
{
try
{
Entities objdbContext = new Entities();
List<USER> result = objdbContext.USERS.ToList();

var rows = JsonConvert.SerializeObject(result);


return rows;


}
catch (Exception)
{


throw;
}
}



$('#example').dataTable({
"bServerSide": true,
"bProcessing": true,
"sAjaxSource": 'WebForm3.aspx/GetU',
"fnServerData": function (sSource, aoData, fnCallback) {
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
url: sSource,
dataType: "json",
success:
function (msg) {
var j = JSON.parse(msg.d);
fnCallback(j);

}


});
}




});




<table id="example" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>USERNAME</th>
<th>ID</th>
</tr>
</thead>




<tfoot>
<tr>
<th>USERNAME</th>
<th>ID</th>
</tr>
</tfoot>
</table>



اینم متن خطا :

133458