Search code examples
asp.netasp.net-mvc-3controlshttpcontext

reusing an asp.net custom server control in MVC3


I have an asp.net custom server control. Is there anyway I can reuse it in MVC3? My existing asp.net control relies quite a bit on storing the information in HttpContext. If I can somehow make the control go through the asp.net page lifecycle in MVC3, then maybe I can work with some of this information with minimal rewrite in MVC3.

Is there a way I can make the asp.net Httpcontext coexist with the MVC3 HttpContext?

Thanks


Solution

  • ASP.Net MVC uses the same HttpContext class, through the thin HttpContextWrapper class.

    However, most ASP.Net server controls will not work in MVC.