MVC使用form传参查询存入前台kendoGrid

<form action="/Project/XiangMuChaXun/Seach" method="post">

<input id="ProjectNumber" name="ProjectNumber">

<button type="submit" class="clearSelection k-button">查询</button>
</form>

.css文件

[HttpPost]
public ActionResult Seach(Seach seach)//model前台存值
{

  string userName = seach.ProjectNumber;//取出

if (dt != null)
{

DataTable dt = OracleSqlHelper.OracleSqltable(sql);
if (dt != null)
{
ViewBag.Data = Newtonsoft.Json.JsonConvert.SerializeObject(General.arraylist(dt));
return View();

}


}

}

前台JQ取出kendoGrid

<script>
$(function () {
var data = '@Html.Raw(ViewBag.Data)';
$("#grid").kendoGrid({
batch: true,
dataSource: data,

height: 550,
groupable: false,
sortable: false,
pageable: {
refresh: false,
pageSizes: false,
buttonCount: 5
},
columns: [{
field: "TASK_ID",
title: "序号",
width: 120
}, {
field: "任务编号",
title: "项目ID"
}

]
});


});
</script>

 

posted @ 2017-04-25 19:35  914556495  阅读(408)  评论(0编辑  收藏  举报