【发布时间】:2015-11-24 14:10:27
【问题描述】:
这是我的操作:
[HttpPost, ValidateAntiForgeryToken]
public ActionResult GetData()
{
//get data from DB and populate model with data
return View("Data", model);
}
观点是:
@model UI.Models.DataModel
@{
var grid = new WebGrid(Model.listTest,
null,
defaultSort: "Id",
rowsPerPage: 25,
canPage: true,
canSort: true
);
}
@if (Model.listTest != null)
{
@grid.GetHtml()
}
在这种特殊情况下,如何在使用 angularjs(而不是 Ajax)调用操作后填充 gridview 而无需加载整个页面?
我没有编写任何代码来使其异步,因为我对 angularjs 一无所知。这将是我学习它的第一步。
更新:
- 我知道如何在 Ajax 中做到这一点,我想学习 AngularJS。只在 Ajax 中做这些事情会更好吗?还是 AngularJS 比 Ajax 更好?
【问题讨论】:
标签: javascript c# angularjs asp.net-mvc asynchronous