title: asp.net user control binding
body: <p>i created a user control with a custom property in the asp.net like the following. In the aspx page that uses this user control i have something like the following. The user control is in a FormView's EditItemTemplate</p>
  
  <pre><code>&lt;uc1:MyControl ID="c1" runat="server" CountryCode='&lt;%# this.DropDownCountry.SelectedValue %&gt;' Value1='&lt;%# Bind("Value1Col") %&gt;' /&gt;
  </code></pre>
  
  <p>I am trying to use the <code>CountryCode</code> in the <code>Page_Load</code> method of the user control, but the value has not be populated. </p>
  
  <p>My question is at which stage in the control's life cycle does the bounded value gets populated? I tried assigning value directly like the following and it does get its value at the <code>Page_Load</code> method.</p>
  
  <pre><code>&lt;uc1:MyControl ID="c1" runat="server" CountryCode="CA" Value1='&lt;%# Bind("Value1Col") %&gt;' /&gt;
  </code></pre>
  
  <p>thanks,</p>
  
  <p>the <strong>uc1:MyControl</strong> has the following property:</p>
  
  <pre><code>[Browsable(true)]
  [Bindable(true, BindingDirection.TwoWay)]
  [DefaultValue(0)]
  [PersistenceMode(PersistenceMode.Attribute)]
  public string CountryCode
  {
      get { return _countryCode; }
      set { _countryCode = value; }
  }
  </code></pre>