title: How to pass properties by reference in c#?
body: <p>I am not sure if I have asked the question correctly. Please correct me if I am wrong.</p>
  
  <p>Anyways, we would like to use a variable's value on a different phases of the page's life cycle.</p>
  
  <p>So for example,</p>
  
  <pre><code>public partial class TestUserControl: UserControl{
      public TestUserControl(){
          Objects = new List&lt;object&gt;(){
              Property1,
              Property2,
              Property3
          };
      }
  
      public int Property1 { get; set; }
      public bool Property2 { get; set; }
      public string Property3 { get; set; }
      public List&lt;object&gt; Objects { get; set; }
  
      protected override OnLoad(EventArgs e){
          foreach(var item in Objects){
              Page.Controls.Add(new LiteralControl(item.ToString() + "&lt;br/&gt;"));
          }
      }
  }
  </code></pre>
  
  <p>So if we say the values of Property1, Property2, Property3 are set as they were written on the tag, how could we use the properties' values just as when needed?</p>
  
  <p>That on the constructor, instead of the values of the properties will be listed down on the List, only the Properties' names will be listed down so their current values will be used on OnLoad.</p>
  
  <p>Thanks a lot.</p>
  
  <p><hr/>
  Edit: I have adopted deerchao's and Jon's approach, but there seems to be another problem we will be facing... It's like:</p>
  
  <pre><code>public partial class TestUserControl: UserControl{
      public TestUserControl(){
          Objects = List&lt;Func&lt;object&gt;&gt;{
              () =&gt; Property1,
              () =&gt; Property2,
              () =&gt; Property3
          };
      }
  
      public int Property1 { get; set; }
      public bool Property2 { get; set; }
      public string Property3 { get; set; }
      public List&lt;Func&lt;object&gt;&gt; Objects { get; set; }
  
      protected override OnLoad(EventArgs e){
          foreach (var item in Objects) {
              //Here is the problem... can we get the variable name using this approach?
              //We have tried some other ways like reflection and expressions but to no avail. Help please =)
              string key = GetVariableName(item());
  
              string value = item() == null ? string.Empty : item().ToString();
              Page.Controls.Add(new LiteralControl(key + " : " + value + "&lt;br/&gt;"));
          }
      }
  }
  </code></pre>