<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: "序号",
120
}, {
field: "任务编号",
title: "项目ID"
}
]
});
});
</script>