Search code examples
asp.netasp.net-mvcuser-controlsasp.net-mvc-4webusercontrol

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


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


Solution

  • 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.