0

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?

1
  • No, you can't use a GridView directly in MVC. Commented Aug 3, 2015 at 15:16

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.