我根据this topic做了jqGrid。我有几个问题。我会很感激一段代码
为什么在添加navGrid后切换边停止工作?
更新
editurl: "/Home/GridEdit",
我添加了代码cshtml。
控制器 VER1
public ActionResult GridEdit(int id, string Name, string Age)
{
Cat e = DB.Cats.SingleOrDefault(p => p.CatID == id);
if (!(e == null))
{
e.CatName = Name;
e.Age = Age;
DB.SaveChanges();
return Content("true");
}
else
{
return Content("false");
}
}
VER2
public ActionResult GridEdit(Cat cat)
{
if (ModelState.IsValid)
{
DB.Entry(cat).State = EntityState.Modified;
DB.SaveChanges();
return RedirectToAction("Index");
}
return View();
}
他们都没有工作......
答案 0 :(得分:0)
2)为什么搜索添加编辑删除不工作
让你的分页工作你需要在你的代码中添加一些代码
public HttpResponseMessage PostProduct(Product item)
{
//Codes
}
public void PutProduct(int id, Product item)
{
//Codes
}
记住这些PostProducts,PutProducts是我的界面