ASP.NET 页生命周期概述

        protected void Page_PreInit(object sender, System.EventArgs e)

        {

            if (IsPostBack)

            {

                //Label1.Text += "Page.PreInti Event<br/>";

            }

        }



        protected void Page_Init(object sengder, EventArgs e)

        {

            Label1.Text += "Page.Init Event<br/>";

        }



        protected void Page_InitComplete(object sender, EventArgs e)

        {

            Label1.Text += "Page.InitComplete<br/>";

        }



        protected void Page_PreLoad(object sender, EventArgs e)

        {

            Label1.Text += "Page.PreLoad Event<br/>";

        }



        protected void Page_Load(object sender, EventArgs e)

        {

            Label1.Text += "Page.Load Event<br/>";

            if (Page.IsPostBack)

            {

                Label1.Text += "Send back request<br/>";

            }

        }



        protected void Page_LoadComplete(object sender, EventArgs e)

        {

            Label1.Text += "Page.LoadComplete Event<br/>";

        }



        protected void Page_PreRender(object sender, EventArgs e)

        {

            Label1.Text += "Page.PreRender Event<br/>";

        }



        protected void Page_Render(object sender, EventArgs e)

        {

            Label1.Text += "Page.Render Event";

        }



        protected void Page_Unload(object sender, EventArgs e)

        {

            //Label1.Text += "Page.Unload Event<br/>";

        }



        protected void Button1_Click(object sender, EventArgs e)

        {

            Label1.Text += "Button.Click Event<br/>";

        }

  http://msdn.microsoft.com/zh-cn/library/ms178472.aspx#general_page_lifecycle_stages

你可能感兴趣的:(asp.net)