INTRODUCTION
In this article, I am explain How to Display Data In Webgrid And Delete Multiple Rows By Using Checkboxes In MVC 5 Application.CREATE NEW PROJECT.
Go to File > New > Project > Select asp.net web application (with .NET Framework 4.5) > Enter Application Name > Click OK > Select Empty MVC Template > OK
Create Table.
Add Entity data model.
In previous articles I explained how to add entity data model. here
ADD A NEW CONTROLLER.
Go to Solution Explorer > Right Click on Controllers folder form Solution Explorer > Add > MVC5 Controller- Empty > Enter Controller name Home > Add.
ADD NEW ACTION INTO YOUR CONTROLLER FOR DISPLAY DATA IN WEBGRID.
Here I have added "List" Action into "Home" Controller. write this following code.
ADD VIEW FOR for the LIST ACTION
Right Click on Action Method (here right click on form action) > Add View...
Rebuild solution before add view.
Write following code into List view.
ADD ANOTHER ACTION INTO YOUR CONTROLLER FOR DELETE MULTIPLE ROWS AT ONCE.
Here I have added "Delete" Action into "Home" Controller.
write this following code .
RUN APPLICATION(CTTL + F5).
2 comments
Hi, this is really an useful article. I followed this but on click of delete button it doesn't post the data to the controller. is there any issues in this article?
ReplyHello, there is no issue in article. its working fine. Please check your controller and action name in your view page.
ReplyPost a Comment