Search code examples
c#.netfindcontroldatarepeater

How can i find a control in the footer template of a data repeater


ASPX : Code

<asp:repeater id="repeater" runat="server">

<headerTemplate></headerTemplate>

<itemtemplate></itemtemplate>

<footerTemplate> <asp:literal id=findme runate=server> </footerTeplate>

</asp:repeater>

What i am looking for is source code to be able to find the control within the footer of a data repeater. Im familiar with the basic "FindControl" when i do a databind or look for control within the page itself, but how can i find the control within a footer template of a data repeater?

Is this even possible? and if so how can i please get some assistance,

thanks again to all!!!

[update]

i need to be able to do this after the databind


Solution

  • Protected Sub Repeater1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles Repeater1.ItemDataBound
        If e.Item.ItemType = ListItemType.Footer Then
            Dim Lit As Literal = CType(e.Item.FindControl("findme"), Literal)
        End If
    End Sub