【转】后端取得当前PAGE的方法

园子里看到的比较好的一个方法   实现IHttpHandlerFactory,从GetHandler里获得

public
 IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated)
      {
          if (Roles.Length == 0)//如果角色属性没有的话,抛出异常
        throw new Exception("初始化属性时失败!请联系 Ants"); }            PageHandlerFactory factory = (PageHandlerFactory)Activator.CreateInstance(typeof(PageHandlerFactory), true);
         IHttpHandler handler = factory.GetHandler(context, requestType, url, pathTranslated);//获取当前的Hander
           Execute(handler);//执行验证方法
           return handler;//返回处理过后的Hander
    }
原文地址:https://www.cnblogs.com/niuniu502/p/1220083.html