示例#1
0
        public void ProcessRequest(HttpContext context)
        {
            logger.Info("Started request");
            try
            {
                if (!SecurityHelper.CheckAccess())
                {
                    context.Response.StatusCode = 401;
                    context.Response.End();
                    return;
                }

                WriteResponse(context);
            }
            catch (NotImplementedException ex)
            {
                context.Response.StatusCode = 501;
                context.Response.Write(new JavaScriptSerializer().Serialize(ex.Message));
                logger.Error(ex);
            }
            catch (Exception ex)
            {
                logger.Error("Exception occurred:", ex);
                throw;
            }

            logger.Info("Finished request");
        }
示例#2
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     if (!SecurityHelper.CheckAccess())
     {
         AccessDenied();
     }
 }
示例#3
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!SecurityHelper.CheckAccess())
            {
                AccessDenied();
            }

            if (IsPostBack)
            {
                return;
            }

            LoadData();
        }
示例#4
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!SecurityHelper.CheckAccess())
            {
                AccessDenied();
            }

            if (IsPostBack)
            {
                return;
            }

            GetQueryStringParameters();
            LoadAndDisplayData();
        }