代码
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)
{
}
}

浙公网安备 33010602011771号