Page Lifecycle ASP.Net Tutorial

<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    Button Search


    
    

            id="lblSearch"
        Text="Search:"
        Runat="server" />
            id="txtSearch"
        Runat="server" />
            id="btnSearch"
        Text="Go!"
        PostBackUrl="NextPage.aspx"
        Runat="server" />
    

    


File: NextPage.aspx
<%@ Page Language="C#" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    void Page_Load()
    {
        if (PreviousPage != null)
        {
            TextBox txtSearch = (TextBox)PreviousPage.FindControl("txtSearch");
            lblSearch.Text = String.Format("Search For: {0}", txtSearch.Text);
        }
    }



    Button Search Results


    
    

            id="lblSearch"
        Runat="server" />