Can i use Asp.Net WebForm User Controls in MVC Site?

Jigar Pandya picture Jigar Pandya · Mar 15, 2012 · Viewed 7.8k times · Source

I have a website in asp.net 4.0 with 10 pages and 12 user controls.

Now i want to migrate this site in asp.net MVC 4.0; So can I re-use those user controls (that are there in traditional asp.net) and render them using <%= Html.RenderUserControl() %>.

In short my question is whether we can use asp.net's user control in asp.mvc 4?

Many thanks,

JIgar

Answer

RickAndMSFT picture RickAndMSFT · Mar 16, 2012

You generally can't use asp.net controls in a MVC application. Almost all controls require view state, which ASP.NET MVC doesn't support.