title: Set a property of a custom user control in the code behind
body: <p>I found this question that shows properties on a custom user control (ascx) can be assigned inline as an HTML attribute: <a href="https://stackoverflow.com/q/5239478/266535">Custom attribute in UserControl (*.ascx)?</a></p>
  
  <p>This works great but what about if I register a custom user control on my page and want to set/get attributes from that control in my code behind?</p>
  
  <p>ASPX:</p>
  
  <pre><code>&lt;%-- I can assign ActivePage inline and this works fine --%&gt;
  &lt;wd:NavBar ID="MyNavBar" runat="server" ActivePage="navbarItem1" /&gt;
  </code></pre>
  
  <p>ASPX.CS:</p>
  
  <pre><code>        // I need to change the ActivePage 
          if (what == "internal")
          {
              RunInternalComparison();
              MyNavBar.ActivePage = "navbarItem1";
          }
          else if (what == "external")
          {
              RunExternalComparison();
              MyNavBar.ActivePage = "navbarItem2";
          }
  </code></pre>
  
  <p>That's what I want to do but it doesn't work. Is this possible?</p>