![](https://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif)
public class MyHandlerFactory : IHttpHandlerFactory
{
public IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated)
{
PageHandlerFactory factory = (PageHandlerFactory)Activator.CreateInstance(typeof(PageHandlerFactory),true);
IHttpHandler handler = factory.GetHandler(context, requestType, url, pathTranslated);
if (handler is Page)
{
(handler as Page).Theme = "Blue";
}
return handler;
}
public void ReleaseHandler(IHttpHandler handler)
{
}
}
{
public IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated)
{
PageHandlerFactory factory = (PageHandlerFactory)Activator.CreateInstance(typeof(PageHandlerFactory),true);
IHttpHandler handler = factory.GetHandler(context, requestType, url, pathTranslated);
if (handler is Page)
{
(handler as Page).Theme = "Blue";
}
return handler;
}
public void ReleaseHandler(IHttpHandler handler)
{
}
}