title: ASP.NET user control: Page_Load fires before property is set
body: <p>This is driving me crazy.</p>
  
  <p>I have a very simple user control:</p>
  
  <pre><code>public int? ImageId {set; get;}
  
  protected void Page_Load(object sender, EventArgs e)
  {
       ... do something with ImageId...
  }
  </code></pre>
  
  <p>And then I put this control on the page with ListView within UpdatePanel:</p>
  
  <pre><code>&lt;asp:ListView ID="ListViewImages"  runat="server" DataSourceID="src"&gt;
    &lt;LayoutTemplate&gt;
      &lt;asp:PlaceHolder ID="itemPlaceholder" runat="server" /&gt;
    &lt;/LayoutTemplate&gt;
    &lt;ItemTemplate&gt;
      &lt;My:MyControl ImageId='&lt;%# Eval("Id") %&gt;' ID="cipPreview" runat="server"  /&gt;
    &lt;/ItemTemplate&gt;
  &lt;/asp:ListView&gt;
  </code></pre>
  
  <p>The problem is Page_Load fires BEFORE ASP.NET sets ImageId. With debugger's help I found out that for some reason ImageId in MyControl IS SET, but it happens only after Page_Load has finished processing. What's wrong?</p>