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}")); //}; }
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 }); } }
//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; } }
//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"); }
protected void Page_Unload(object sender, EventArgs e) { EventCollection.Add(EventSource.Control, "Unload"); }
protected override void Render(HtmlTextWriter writer) { EventCollection.Add(EventSource.Control, "Render"); base.Render(writer); }
protected void Page_PreRender(object sender, EventArgs e) { EventCollection.Add(EventSource.Control, "PreRender"); }
protected void Page_PreLoad(Object src, EventArgs args) { EventCollection.Add(EventSource.Page, "PreLoad"); }
//protected void Application_AuthenticateRequest(object sender, EventArgs e) //{ //} protected void Application_EndRequest(Object sender, EventArgs e) { EventCollection.Add(EventSource.Application, "ENdRequest"); }
protected void HandleEvent(Object sender, ViewCounterEventArgs args) { EventCollection.Add(EventSource.Page, String.Format($"Control - Counter : {args.Counter}")); }
protected void Page_Unload(Object sender, EventArgs args) { EventCollection.Add(EventSource.Page, "Unload"); }
protected void Page_SaveStateComplete(Object src, EventArgs args) { EventCollection.Add(EventSource.Page, "SaveStateComplete"); }
protected void Page_PreRenderComplete(Object src, EventArgs args) { EventCollection.Add(EventSource.Page, "PreRenderComplete"); }
protected void Page_LoadComplete(Object src, EventArgs args) { EventCollection.Add(EventSource.Page, "LoadComplete"); }
protected void Page_Load(Object src, EventArgs args) { mySpan.InnerText = Server.HtmlEncode("Hello World."); EventCollection.Add(EventSource.Page, "Load"); }
protected void Application_Start(object sender, EventArgs e) { EventCollection.Add(EventSource.Application, "Start"); //Application["message"] = "Application Event"; }
//protected void Session_Start(object sender, EventArgs e) //{ //} protected void Application_BeginRequest(object sender, EventArgs e) { EventCollection.Add(EventSource.Application, "BeginRequest"); }
protected void Page_Init(object sender, EventArgs e) { EventCollection.Add(EventSource.Control, "Init"); }
protected void Application_PostRequestHandledExecute(Object sender, EventArgs args) { EventCollection.Add(EventSource.Application, "PostRequestHandledExecute"); }
protected void Page_Init(Object src, EventArgs args) { EventCollection.Add(EventSource.Page, "Init"); }