Does ASP.NET MVC use the regular toolbox controls?

后端 未结 7 2104
予麋鹿
予麋鹿 2020-12-15 01:55

In ASP.NET MVC, do I use the \"regular\" controls from the toolbox and assign data to them like I did with webforms? Can I use the gridview, for example?

Thank you.<

相关标签:
7条回答
  • 2020-12-15 02:26

    ASP.Net MVC is focused around generating your own HTML using your View Templates. You can't use Webform controls in your Views and have the application handle them the same way as with Webforms. They might render properly, but there is no postback functionality or concept of maintaining their state.

    That being said, you can integrate ASP.Net Webforms with your MVC style pages as well. You can always check out the classic Hanselman walkthrough of having a "hybrid" asp.net application: http://www.hanselman.com/blog/PlugInHybridsASPNETWebFormsAndASPMVCAndASPNETDynamicDataSideBySide.aspx

    0 讨论(0)
提交回复
热议问题