0

Can i create a gridview control in Asp.net MVC,and set its DataSource propertie and DataBind method,mormally as in web forms?

2

2 Answers 2

1

No - ASP.NET MVC has no ViewState and therefore no native WebForms controls will work.

There are a number of hybrid approaches for people who wish to use controls in MVC but if you wish to work in that way it would be better to use WebForms.

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

Comments

1

Technically it is possible - wrap the grid inside a <form runat="server"> tag and you are back in the WebForms business - ViewState, postback etc. However I would too not recommend this approach. You better use a mixed WebForms-MVC approach. You can also check the available grid solutions for MVC.

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.