Geeks With Blogs
Bala's Weblog The programmer's space. February 2014 Entries
Delete ASP.NET MVC record
Delete is simpler way to achieve in ASP.NET MVC. There are multiple ways to delete the data as like Create/Edit. 1. Delete using HTTP Get Add a hyperlink in the Index view and add a controller action method for Http Get Delete action. [HttpGet] [ActionName("Delete")] public ActionResult Delete_get(int Id) { Employee emp = employeecontext.employees.S... == Id); employeecontext.employees.R... employeecontext.SaveChanges(); return RedirectToAction("Index"); } @Html.ActionLink("Delete", ......

Posted On Sunday, February 2, 2014 12:47 PM

Edit in ASP.NET MVC
Edit can be achievable in ASP.NET MVC through Get and Post Methodology. Let us directly go to the example of editing all the values in the model not leaving any one values. 1 Editing all Model attributes:- Add an hyperlink Action to redirect to another Edit Page using HTTP Get Requests. @Html.ActionLink("Edit", "Edit", new { @Id = item.Id}, null); The Edit Get Request Action method looks like [HttpGet] [ActionName("Edit")] public ActionResult Edit_get(int Id) { Employee emp = employeecontext.employees.S... ......

Posted On Sunday, February 2, 2014 12:15 PM

Copyright © Balamurugan Alagumalai | Powered by: GeeksWithBlogs.net