Use ASP.NET Web Forms UserControl in ASP.NET MVC?

I was tasked with creating a prototype web application, and I discuss this using ASP.NET WebForms or the new ASP.NET MVC.

There is a commercial ASP.NET UserControl that I would like to use, which gives me 95% of the functionality I need (and it does it in AJAX-y mode). But I heard that since ASP.NET MVC does not use ViewState, it cannot manage these elements based on WebForms.

So is it true or false?

I would really like to use this commercial UserControl, but I want to use ASP.NET MVC if I can, and only if ASP.NET MVC will not bother me much when trying to use WebForms control.

+6
asp.net-mvc
source share
2 answers

Traditional WebForms and MVC are not mutually exclusive; You can run both of them on one site. For an explanation of how to do this, see this post by Scott Hanselman .

Thus, you could, for example, create WebForms-based pages (s) to use commercial control and use MVC for everything else. You can also set up a simple test to check if the control can work without ViewState, which makes it suitable for use in MVC, and to abandon the hybrid approach.

+8
source share

It probably won't work. In the Webforms view, there is no point in viewing, returning (in the sense of Webforms), or the life cycle of a page in which most commercial controls rely in some way.

0
source share

All Articles