DataTableを返してASP.NET AJAXクライアントテンプレートに入力できますか?
-
20-08-2019 - |
質問
次のサーバー側コードが機能します:
[OperationContract]
public IEnumerable<object> GetBooks() {
var people = new List<object>
{
new Book{ Author="Richard Preston", Title="The Hot Zone"},
new Book{ Author="Jim Norton", Title="I Hate Your Guts"}
};
return people.AsEnumerable();
}
クライアント側のコードの一部を次に示します。
<table class="Template">
<thead>
<tr>
<th>Author</th>
<th>Title</th>
</tr>
</thead>
<tbody id="bookListView">
<tr>
<td>{{Author}}</td>
<td>{{Title}}</td>
</tr>
</tbody>
</table>
function pageLoad() {
$create(Sys.UI.DataView, { serviceUri: "MyService.svc", query: "GetBooks" }, {}, {}, $get("bookListView"));
}
DataTableをクライアントに返し、各列の名前を参照するだけでクライアントテンプレートにデータを入力できるようにしたいと思います。それは可能ですか?
解決
遅延回答、しかしはい-不足しているのはclass = <!> quot; sys-template <!> quot; bookListView tbodyで。
所属していません StackOverflow