title: Changing the code behind
body: <p>I'm supposed to change the frmPersonnelVerified code behind to get the values from the Session state items.</p>
  
  <p>Here is my session state code:</p>
  
  <pre><code>public partial class frmPersonnel : System.Web.UI.Page 
  { 
      protected void btnSubmit_Click(object sender, EventArgs e) 
      { 
          try 
          { 
              //Checking validation for the text boxes 
              if (string.IsNullOrEmpty((txtFirstName.Text ?? string.Empty).Trim())) 
              { 
                  txtFirstName.BackColor = System.Drawing.Color.Yellow; 
                  lblError.Text += "Please enter first name! &lt;br /&gt;"; 
              } 
  
              if (string.IsNullOrEmpty((txtLastName.Text ?? string.Empty).Trim())) 
              { 
                  txtLastName.BackColor = System.Drawing.Color.Yellow; 
                  lblError.Text += "Please enter last name! &lt;br /&gt;"; 
              } 
              if (string.IsNullOrEmpty((txtPayRate.Text ?? string.Empty).Trim())) 
              { 
                  txtPayRate.BackColor = System.Drawing.Color.Yellow; 
                  lblError.Text += "Please enter pay rate! &lt;br /&gt;"; 
              } 
              if (string.IsNullOrEmpty((txtStartDate.Text ?? string.Empty).Trim())) 
              { 
                  txtStartDate.BackColor = System.Drawing.Color.Yellow; 
                  lblError.Text += "Please enter start date! &lt;br /&gt;"; 
              } 
              if (string.IsNullOrEmpty((txtEndDate.Text ?? string.Empty).Trim())) 
              { 
                  txtEndDate.BackColor = System.Drawing.Color.Yellow; 
                  lblError.Text += "Please enter end date! &lt;br /&gt;"; 
              } 
  
              DateTime dt1; 
              DateTime dt2; 
  
              dt1 = DateTime.Parse(txtStartDate.Text); 
              dt2 = DateTime.Parse(txtEndDate.Text); 
  
              if (DateTime.Compare(dt1, dt2) &gt; 0) 
              { 
                  //Checking if the end date is greater than the start date 
                  txtStartDate.BackColor = System.Drawing.Color.Yellow; 
                  txtEndDate.BackColor = System.Drawing.Color.Yellow; 
                  lblError.Text += "Start Date must not be greater than End Date! &lt;br /&gt;"; 
              } 
  
              else 
              { 
                  //output information if correct validation 
                  Session["txtFirstName"] = txtFirstName.Text; 
                  Session["txtLastName"] = txtLastName.Text; 
                  Session["txtPayRate"] = txtPayRate.Text; 
                  Session["txtStartDate"] = txtStartDate.Text; 
                  Session["txtEndDate"] = txtEndDate.Text; 
                  Server.Transfer("frmPersonalVerified.aspx"); 
              } 
          } 
          catch (Exception ex) 
          { 
  
          } 
      } 
  }
  </code></pre>
  
  <p>I have a submit button that when pressed is supposed to input the above information into a text box on another page if it validates correctly.  Right now it doesn't do that.</p>
  
  <p>Here is my code on frmPersonnalVerified:</p>
  
  <pre><code>public partial class frmPersonnelVerified : System.Web.UI.Page 
  { 
      protected void Page_Load(object sender, EventArgs e) 
      { 
          //Inputs information from frmPersonnel and places it into the  
          //textbox called "txtVerifiedInfo" 
          txtVerifiedInfo.Text = Request["txtFirstName"] + 
              "\n" + Request["txtLastName"] + 
              "\n" + Request["txtPayRate"] + 
              "\n" + Request["txtStartDate"] + 
              "\n" + Request["txtEndDate"]; 
  
      } 
  
  }
  </code></pre>