If one has an ASP.net web site whose web forms all inherit from a common base page--which checks things like authentication and redirects when a session has expired, etc--is there a way to use this base class in a ashx handler? I started going down that road by inheriting the base page class in the handler and realized this might not be a recommended practice. Any thoughts on how to avoid code duplication here?
Can this
public class FooHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
become this
public class FooHandler : BasePageClass, IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
I get the following warning, which is what made me reconsider what I was doing:
FooHandler.ProcessRequest(System.Web.HttpContext) hides inherited member System.Web.UI.Page.ProcessRequest(System.Web.HttpContext). To override that implementation, add the override keyword. Otherwise add the new keyword.