<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="PageFlowTracing" Trace="true"%>
Page Flow
File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class PageFlowTracing : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
lblInfo.Text += "Page.Load event handled.
";
if (Page.IsPostBack)
{
lblInfo.Text += "This is the second time you've seen this page.
";
}
}
private void Page_Init(object sender, System.EventArgs e)
{
lblInfo.Text += "Page.Init event handled.
";
}
protected void Button1_Click(object sender, System.EventArgs e)
{
Trace.Write("Button1_Click", "About to update the label.");
lblInfo.Text += "Button1.Click event handled.";
Trace.Write("Button1_Click", "Label updated.");
}
private void Page_PreRender(object sender, System.EventArgs e)
{
lblInfo.Text += "Page.PreRender event handled.
";
}
private void Page_Unload(object sender, System.EventArgs e)
{
lblInfo.Text += "Page.Unload event handled.
";
}
}