あれらの年の友达は、知っているべきASP.NET-ページロード順

1286 ワード

public partial class _Default : System.Web.UI.Page
{
    //            

    //    OnPreInit    ,               (   )。
    //          PageTheme   MasterPage      。
    protected void Page_PreInit ( object sender , EventArgs e )
    {
        Response.Write ( "Page_PreInit<br>" );
    }
    //     
    protected void Page_Init ( object sender , EventArgs e )
    {
        Response.Write ( "Page_Init<br>" );
    }
    //       
    protected void Page_InitComplete ( object sender , EventArgs e )
    {
        Response.Write ( "Page_InitComplete<br>" );
    }
    //    
    protected void Page_Load ( object sender , EventArgs e )
    {
        //IsPostBack Page    bool     ,        Form               。
        // IsPostBack=true         ,    PostBack, IsPostBack=false        
        if ( !IsPostBack )//             Page_Load   
            Response.Write ( "Page_Load<br>" );
    }
    protected void Button1_Click ( object sender , EventArgs e )
    {
        Response.Write ( "Button1_Click<br>" );
    }
    //      
    protected void Page_LoadComplete ( object sender , EventArgs e )
    {
        Response.Write ( "Page_LoadComplete<br>" );
    }

}