I'm writing a component that I would like to be able to use in both MVC and WebForms web apps, but I'm not sure how to handle the differences between how HttpContext is handled.
My component involves a custom IHttpHandler (for WebForms) or a custom ActionResult (for MVC).
So I've got a few questions:
- Is there a way to use an IHttpHandler with MVC without breaking the model?
- Is it acceptable to use HttpContext.Current while attempting to write code that will work for both? It seems a little brute-force-ish to me (not sure why), but the alternative would be writing and implementing an fairly verbose interface to handle the abstraction between HttpContext and ControllerContext.
- Am I going about this completely wrong?