asp.net webformではjqueryデータシートを使用してサーバーサイドページングを実装しようとしていますが、URLで渡されたバックエンドメソッドを呼び出すことはできません。DataTableを使用してasp.net Webフォームでサーバーサイドページングを実行できません
は、私は、HTML以下でTestServerSidePaging.aspxページを持っている:
<div >
<table id="example">
<thead>
<tr style="text-align:left;">
<th>Name</th>
<th>Age</th>
<th>DoB</th>
</tr>
</thead>
<tfoot>
<tr style="text-align:left;">
<th>Name</th>
<th>Age</th>
<th>DoB</th>
</tr>
</tfoot>
</table>
スクリプト:
$('#example').DataTable({
"processing": true,
"serverSide": true,
"ajax":{
"url": "TestServerSidePaging.aspx/Test",
"type": "GET",
"data": ""
}
});
バックエンドTestServerSidePaging.aspx.cs:
[WebMethod]
public string Test()
{
// returns data
}
メソッドTest()は起動されません。私が紛失しているものはありますか?
あなたは '$(ドキュメント).ready()' –
でスクリプトコードを入れてのコンソールをチェックする必要がブラウザ、エラーがありますか? –