FindControl doesn't work with bind server tag, why?
<p>I have a FindControl in OnLoad event to find my button on page i.e.:</p>

<pre><code>protected override void OnLoad(EventArgs e)
{
    DataBind();
    control button = Page.FindControl("myButton");
}
</code></pre>

<p>on my aspx page I have </p>

<pre><code>&lt;asp:Button runat="server" ID="myButton" /&gt;
</code></pre>

<p>If I only have this, everything works, when I pass in the OnLoad, button is not null and I can execute what I want. The problem is when I add dynamic text in my aspx:</p>

<pre><code>&lt;asp:Button runat="server" ID="myButton" Text='&lt;%# "Here is my dynamic text pulled from a XML" %&gt;' /&gt;
</code></pre>

<p>Then the FindControl finds nothing and the button is null.</p>

<p>Adding a binding server tag on aspx isn't suppose to delay anything right? When I inspect the Page object I have some controls in Controls collection, but I'm unable to find myButton.</p>

<p>Any idea on what I am doing wrong?</p>

<p><strong>EDIT</strong></p>

<p>People seem to think that my code example is my real code but it <strong>isn't</strong>, So I use FindControl because I need to since I have nested controls and I cannot access it directly and I use binding because the dynamic text I'm putting is inside a ContentTemplate which I can override in other page aspx.</p>

<p>The question I asked was more specific to the fact that I have traced the problem where my FindControl returns null because a newly implement behaviour which is the binding.</p>

<p>Improving the code example isn't a solution or an explanation to the fact that if I put a &lt;%# %> tag in my aspx page, the FindControl in the OnLoad event return null.</p>

<p><strong>EDIT 2</strong></p>

<p>the bind tag alone seems to not be the culprit but the DataBind() to populate them. Whether or not I have bind tag, putting DataBind() before the FindControl makes the myButton to be null. Correction in code example was made.</p>
