Can't find a link button in a repeater
<p>I have a link button in a repeater with a couple of databound fields. I'm trying to get to where I can set the buttons onClientClick after the databinding however everytime I try to access the link button I keep getting Null returned.</p>

<p>I've looked through every single question involving repeaters and controls here and haven't been able to figure it out.</p>

<p>The .aspx</p>

<pre><code>    &lt;asp:Repeater ID="DailyRepeater" OnItemCommand="DailyRepeater_ItemCommand" runat="server"&gt;
                    &lt;HeaderTemplate&gt;
                        &lt;tr&gt;
                            &lt;td class="coltitle"&gt;
                                Time
                            &lt;/td&gt;
                            &lt;td class="coltitle"&gt;
                                Activity
                            &lt;/td&gt;
                            &lt;td class="coltitle"&gt;
                                Hours
                            &lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/HeaderTemplate&gt;
                    &lt;ItemTemplate&gt;
                        &lt;tr class="evenrow"&gt;
                            &lt;td&gt;
                                &lt;%# Eval("StartTime","{0:HH:mm}") %&gt;-&lt;%# Eval("EndTime","{0:HH:mm}") %&gt;
                            &lt;/td&gt;
                            &lt;td&gt;
                                &lt;%# Eval("Description") %&gt;
                            &lt;/td&gt;
                            &lt;td&gt;
                                &lt;%# Eval("Hours","{0:0.0}") %&gt;
                            &lt;/td&gt;
                            &lt;td&gt;
                                   &lt;asp:LinkButton runat="server" CausesValidation="false" ID="editbutton" Text="Edit"&gt;Edit&lt;/asp:LinkButton&gt;
                            &lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/ItemTemplate&gt;
</code></pre>

<p>The .aspx.cs</p>

<pre><code>    protected void DailyRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        LinkButton myButton = (LinkButton)e.Item.FindControl("editbutton");
        myButton.OnClientClick = (popupWindow.GetTargetPopupCode("URL");
    }
</code></pre>

<p>From what I've read, I should have been able to get to the button using the RepeaterItemEventargs. However I can't seem to find it here. The other thing I thought of was that the binding wasn't happening by the time this happened (which made no sense to be as this is a databound event) but for some reason e is coming back e.Item has a dataItem of null and an itemIndex of -1...</p>

<p>I'm just really confused and lost any help would be greatly appreciated.</p>

<p>Thanks!</p>
