Can a asp.net mvc view page have a webform control on it?

前端 未结 4 627
心在旅途
心在旅途 2021-01-13 17:52

Can a asp.net mvc view page have a webform control on it?

I think I read about it before, but I\'m not sure how it would work since MVC doesn\'t use viewstate etc?

4条回答
  •  攒了一身酷
    2021-01-13 18:16

    Don't forget that MVC implements REST so ViewState is now pretty much obsolete unless you implement it yourself using say hidden fields.

    About the only thing that the WebForm controls were good for was Ajax IMHO.

    If you replace WebForm Controls with Partial Views, WebControl classes and jQuery plugins then you can achive the same.

    I'm currently leaning towards writing my own WebControls and jQueryPlugins and referencing them within PartialViews.

    There are heaps of jQuery plugins now available which perform pretty much all the actions that the WebForm controls did.

提交回复
热议问题