user1250264
user1250264

Reputation: 905

Gridview control for ASP.NET MVC

I am new to ASP.NET MVC and rewriting a webform app to MVC. In my webform, I have asp.net control, GRIDVIEW. Can I add asp.net gridview to MVC? If not, what is the alternative solution?

Upvotes: 0

Views: 515

Answers (1)

zgood
zgood

Reputation: 12621

No you cannot use web form controls ( i.e. <asp:GridView />, <asp:ListView />, <asp:Label />) in MVC projects. No massive ViewState thank god lol.

Alternatives:

I personally like DataTables . You can use the NuGet Package manager to find packages that will help you wire up DataTables with MVC by simply typing "datatables mvc" in the search. I have used DataTables.Mvc in a couple projects and have been happy with it so far.

Another way, might be to use the Microsoft WebGrid (System.Web.Helpers namespace). I have used this in a couple project as well, and it seems to to the job. Here is an example of its use.

Upvotes: 3

Related Questions