In this article, I explain how to display data In a Webgrid and delete multiple rows using Checkboxes in a MVC 5 Application.
Create new ProjectGo to "File" -> "New" -> "Project..." then select ASP.Net web application (with .NET Framework 4.5) then enter an Application Name then click OK then select Empty MVC Template then click OK.Create Table Add an Entity Data model.In previous articles I explained how to add an entity data model. Add a new controllerGo to Solution Explorer then right-click on the Controllers folder then Add > MVC5 Controller- Empty then enter Controller name Home then select Add.Add a new action to your controller to display data in WebGrid.Here I have added a "List" Action into the "Home" Controller. Provide this following code. Add view for the list actionRight-click on the Action Method (here right-click on form action) > Add View... Rebuild solution before add view.Write the following code into the List view.Add another action in to your controller to delete multiple rows at once.Here I have added a "Delete" Action into the "Home" Controller. Provide the following code.Run the application (CTTL + F5).
Hands on ASP.NET GridView