データテーブルJqプラグインからの「無効なjson応答」を取得しています。WebメソッドがJSON形式に正しくシリアル化されていないと思われます。私がフォーマットをテストしたとき、私はそれが有効であることを発見した(http://jsonlint.com/)。私は、WebMethod属性の出力がDatatable Jquery Pluginの実装
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" xmlns:d1p1="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/" d1p1:type="q1:string">
{"Table":[{"Filenum":15112777,"FullName":"marwam saleh moh saleem","DOB":"2015-11-26T00:00:00"}]}
</anyType>
<table id="RegSrc2" class="table table-bordered table-striped">
<thead>
<tr>
<th><b>File Number</b></th>
<th><b>Patient Name</b></th>
<th><b>DOB</b></th>
</tr>
</thead>
<tbody></tbody>
<tfoot>
<tr>
<th><b>File Number</b></th>
<th><b>Patient Name</b></th>
<th><b>DOB</b></th>
</tr>
</tfoot>
</table>
$(document).ready(function() {
var $table = $('#RegSrc2');
$table.dataTable({
bProcessing: true,
"serverSide": true,
"sAjaxSource": $table.data('../CONFIG/WebSerTblsSearch.asmx/SrcTblRegx'),
})
});
は、私があまりにも
jquery.dataTables.js:3929 Uncaught TypeError: Cannot set property 'data' of null
at _fnBuildAjax (jquery.dataTables.js:3929)
at _fnAjaxUpdate (jquery.dataTables.js:3946)
at _fnDraw (jquery.dataTables.js:3409)
at _fnReDraw (jquery.dataTables.js:3528)
at _fnInitialise (jquery.dataTables.js:4710)
at loadedInit (jquery.dataTables.js:1320)
at HTMLTableElement.<anonymous> (jquery.dataTables.js:1332)
at Function.each (jquery-2.1.4.js:374)
at jQuery.fn.init.each (jquery-2.1.4.js:139)
at jQuery.fn.init.DataTable [as dataTable] (jquery.dataTables.js:869)
<WebMethod()> _
<ScriptMethod(ResponseFormat:=ResponseFormat.Json, UseHttpGet:=False, XmlSerializeString:=False)> _
Public Function SrcTblRegx()
Dim constr As String = ConfigurationManager.ConnectionStrings("ARTSQLConStrng").ConnectionString
Using con As New SqlConnection(constr)
Using cmd As New SqlCommand("TblRegSearchx", con)
cmd.CommandType = CommandType.StoredProcedure
cmd.Connection = con
Dim ds As New DataSet()
Using sda As New SqlDataAdapter(cmd)
sda.Fill(ds)
End Using
Dim jsondata As String = JsonConvert.SerializeObject(ds)
Return jsondata
End Using
End Using
End Function
ここで問題を把握することはできません
asmxページからWebサービスを使用しているので、それはそのままでは機能しません。 – Bindrid
だから私はashxハンドラを使用する必要がありますか? – JSON
いいえ、テーブルの除外を変更するだけです。数分に私に – Bindrid