我有以下查询字符串参数方法是使用anularjs作为
的POSTvar req = {
method: 'POST',
url: "/UserGrid",
params: {
rows : 15,
page: 1,
sidx : "ID",
sord: "DESC",
_search: true,
filters: {"groupOp":"AND","rules":[{"field":"username","op":"cn","data":"suz"}]}
},
};
$http(req).success(function(data, status, headers, config){
console.log(data)
});
_search:true
filters:{"groupOp":"AND","rules":[{"field":"username","op":"cn","data":"suz"}]}
page:1
rows:3
sidx:ID
sord:desc
我有以下方法
[HttpPost]
public ActionResult UserGrid(bool _search, GridFilterHelper filters, int page, int rows, string sidx, string sord)
{
GridFilterHelper mFilters = filters;
return Json(mFilters);
}
上述代码中的过滤器为 null 。有人可以帮助我如何将过滤器传递给此操作方法。
这里是grifilterHelper类
public class GridFilterHelper
{
public string groupOp { get; set; }
public List<Rules> rules { get; set; }
}
public class Rules
{
public string field { get; set; }
public string op { get; set; }
public string data { get; set; }
}
答案 0 :(得分:0)
查询字符串参数过滤器是字符串而不是对象。所以我把它从字符串改为Json。