title: asp.net databind label control text to property of page baseclass
body: <p>Why is TestString is always empty when I try to output it into my Label?</p>
  
  <p>Base class for all asp.net pages</p>
  
  <pre><code>public class PageBase : System.Web.UI.Page
  {
      protected string TestString { get; set; }
  }
  
  protected override void OnPreInit(EventArgs e)
  {
  TestString = "test string";
  }
  </code></pre>
  
  <p>asp.net page that derives from PageBase and uses a master page.</p>
  
  <pre><code>&lt;asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
      &lt;asp:Label ID="lblContent" runat="server" Text="&lt;%# this.TestString %&gt;" /&gt;
  &lt;/asp:Content&gt;
  </code></pre>