3
Answers

MVC4 CRUD with ASPX view Engine & Entity Framework

Photo of vijay kumar

vijay kumar

11y
921
1
I wanted to do CRUD (create,Retrieve,Update and Delete) operations using 
ASP.Net MVC 4 with ASPX view engine & Entity framework(.edmx file extension)
 
I wrote for Showing the data and Inserting it to the Database.
 
Please tell me how to do it for Update and Delete operations
 
NorthwindEntities obj = new NorthwindEntities();
public ActionResult Cateview()
{
ViewData["Cate"]=obj.Categories.ToList();
return View();
}
public ActionResult InsertCateview()
{
return View();
}
[HttpPost]
public ActionResult InsertCateview([Bind] Category objcate)
{
obj.Categories.Add(objcate);
obj.SaveChanges();
return RedirectToAction("Cateview", "Cate");
}
 

Answers (3)

0
Photo of Minh Lai
NA 74 418 7y
Thanks every body! my problem is solved after delete command anchor Form it load
0
Photo of Zakir Ahamed
NA 1.7k 33.8k 7y
can you give some screen short and explain the only we will solve the problem