示例#1
0
 protected void Page_InitComplete(Object src, EventArgs args)
 {
     EventCollection.Add(EventSource.Page, "InitComplete");
     //counter.Count += (sender, eventArgs) =>
     //{
     //    EventCollection.Add(EventSource.Page, String.Format($"Control - Counter : {eventArgs.Counter}"));
     //};
 }
示例#2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            EventCollection.Add(EventSource.Control, "Load");
            Int32 count;

            if (!Int32.TryParse(Session["counter"]?.ToString(), out count))
            {
                count = 0;
            }
            Session["counter"] = ++count;
            if (Count != null)
            {
                Count(this, new ViewCounterEventArgs()
                {
                    Counter = count
                });
            }
        }
示例#3
0
        //public Global()
        //{
        //    BeginRequest += this.HandleEvent;
        //    EndRequest += this.HandleEvent;
        //    LogRequest += this.HandleEvent;
        //    PreRequestHandlerExecute += this.HandleEvent;
        //    PostRequestHandlerExecute += this.HandleEvent;
        //}

        protected void HandleEvent(Object sender, EventArgs e)
        {
            switch (Context.CurrentNotification)
            {
            case RequestNotification.BeginRequest:
                EventCollection.Add(EventSource.Application, "BeginRequest");
                //if (Request.RawUrl == "/Time")
                //{
                //    Response.Write(Context.Timestamp.ToLongTimeString());
                //    CompleteRequest();
                //}
                if (Request.Browser.Browser.ToLower().IndexOf("chrome") == -1)
                {
                    Response.SuppressContent = true;
                }
                break;

            default:
                String eventName = Context.CurrentNotification.ToString();
                EventCollection.Add(EventSource.Application, eventName);
                break;
            }
        }
示例#4
0
        //protected void Application_PostAuthenticateRequest(object sender, EventArgs e)
        //{
        //    if ((Request.Url.LocalPath == "/Params.aspx") && (!User.Identity.IsAuthenticated))
        //    {
        //        Context.AddError(new UnauthorizedAccessException());
        //    }
        //}

        //protected void Application_LogRequest(object sender, EventArgs e)
        //{
        //    System.Diagnostics.Debug.WriteLine($"Request for {Request.RawUrl} - code {Response.StatusCode}");
        //}

        protected void Application_End(object sender, EventArgs e)
        {
            EventCollection.Add(EventSource.Application, "End");
        }
示例#5
0
 protected void Page_Unload(object sender, EventArgs e)
 {
     EventCollection.Add(EventSource.Control, "Unload");
 }
示例#6
0
 protected override void Render(HtmlTextWriter writer)
 {
     EventCollection.Add(EventSource.Control, "Render");
     base.Render(writer);
 }
示例#7
0
 protected void Page_PreRender(object sender, EventArgs e)
 {
     EventCollection.Add(EventSource.Control, "PreRender");
 }
示例#8
0
 protected void Page_PreLoad(Object src, EventArgs args)
 {
     EventCollection.Add(EventSource.Page, "PreLoad");
 }
示例#9
0
        //protected void Application_AuthenticateRequest(object sender, EventArgs e)
        //{

        //}

        protected void Application_EndRequest(Object sender, EventArgs e)
        {
            EventCollection.Add(EventSource.Application, "ENdRequest");
        }
示例#10
0
 protected void HandleEvent(Object sender, ViewCounterEventArgs args)
 {
     EventCollection.Add(EventSource.Page, String.Format($"Control - Counter : {args.Counter}"));
 }
示例#11
0
 protected void Page_Unload(Object sender, EventArgs args)
 {
     EventCollection.Add(EventSource.Page, "Unload");
 }
示例#12
0
 protected void Page_SaveStateComplete(Object src, EventArgs args)
 {
     EventCollection.Add(EventSource.Page, "SaveStateComplete");
 }
示例#13
0
 protected void Page_PreRenderComplete(Object src, EventArgs args)
 {
     EventCollection.Add(EventSource.Page, "PreRenderComplete");
 }
示例#14
0
 protected void Page_LoadComplete(Object src, EventArgs args)
 {
     EventCollection.Add(EventSource.Page, "LoadComplete");
 }
示例#15
0
 protected void Page_Load(Object src, EventArgs args)
 {
     mySpan.InnerText = Server.HtmlEncode("Hello World.");
     EventCollection.Add(EventSource.Page, "Load");
 }
示例#16
0
 protected void Application_Start(object sender, EventArgs e)
 {
     EventCollection.Add(EventSource.Application, "Start");
     //Application["message"] = "Application Event";
 }
示例#17
0
        //protected void Session_Start(object sender, EventArgs e)
        //{

        //}

        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            EventCollection.Add(EventSource.Application, "BeginRequest");
        }
示例#18
0
 protected void Page_Init(object sender, EventArgs e)
 {
     EventCollection.Add(EventSource.Control, "Init");
 }
示例#19
0
 protected void Application_PostRequestHandledExecute(Object sender, EventArgs args)
 {
     EventCollection.Add(EventSource.Application, "PostRequestHandledExecute");
 }
示例#20
0
 protected void Page_Init(Object src, EventArgs args)
 {
     EventCollection.Add(EventSource.Page, "Init");
 }