title: Create/Use property to get Session variable C#
body: <p>I have an ASPX Web Forms control that imports from another project the Person class.</p>
  
  <pre><code>public partial class cuTest : System.Web.UI.UserControl
  </code></pre>
  
  <p>There I have created in that control a property for an object session and a method to populate that session.</p>
  
  <pre><code>    public Person person
      {
          get
          {
              if (this.Session["Person"] == null)
              {
                  Session["Person"] = new Person();
              }
              return Session["Person"] as Person;
          }
      }
  
      private void crearPago()
      {
          this.person.name = "Max";
          this.person.surname = "Ford";
      }
  </code></pre>
  
  <p>Now when I want to call it from the page that contains that control.
  <code>var x = cuTest.person;</code> I need to check if it's not empty since this can't be null. How can I do that?</p>