Page Lifecycle ASP.Net Tutorial

index.aspx
<%@ Page Language="C#" %>


    public TextBox pp_TextBox1
    {
        get
        {
            return TextBox1;
        }
    }
    public Calendar myCalendar1
    {
        get
        {
            return Calendar1;
        }
    }
    protected void Button1_Click (object sender, System.EventArgs e)
    {
        Label1.Text = "Hello " + TextBox1.Text + "" +
            "Date Selected: " + Calendar1.SelectedDate.ToShortDateString();
    }



    First Page


    
        Enter your name:
        
        
        When do you want to fly?
        
        
                 OnClick="Button1_Click" />
                 PostBackUrl="NextPage.aspx" />
        
    


File: NextPage.aspx
<%@ Page Language="C#" %>
<%@ PreviousPageType VirtualPath="Default.aspx" %>
 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    
    protected void Page_Load(object sender, System.EventArgs e)
    {
      if (Page.IsCrossPagePostBack) {
        Label1.Text = "Hello " + PreviousPage.myTextbox1.Text + "" + 
           "Date Selected: " + 
           PreviousPage.myCalendar1.SelectedDate.ToShortDateString();
      }
      else
      {
         Response.Redirect("Default.aspx");
      }
    }    



    Second Page