locked
Loop through <li> controls in UpdatePanel RRS feed

  • Question

  • User592604931 posted

    How can I loop through the <li> controls below;

    <ul>
    <asp:UpdatePanel ID="pnSubMenu" runat="server">
    <ContentTemplate>
    <li class="fa fa-bars" id="liOrders1" runat="server">&nbsp; Option 1</li>
    <li class="fa fa-bars" id="liOrders2" runat="server">&nbsp; Option 2</li>
    <li class="fa fa-bars" id="liOrders3" runat="server">&nbsp; Option 3</li>
    <li class="fa fa-bars" id="liShop1" runat="server">&nbsp; Option 1</li>
    <li class="fa fa-bars" id="liShop2" runat="server">&nbsp; Option 2</li>
    <li class="fa fa-bars" id="liShop3" runat="server">&nbsp; Option 3</li>
    </ContentTemplate>
    </asp:UpdatePanel>
    </ul>

    Any help really appreciated.

    Thursday, December 4, 2014 12:59 PM

Answers

  • User592604931 posted

    This is the solution FYI:

    For Each li As Object In pnSubMenu.ContentTemplateContainer.Controls
    If TypeOf li Is HtmlGenericControl Then
    li.Visible = False
    End If
    Next

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 4, 2014 4:37 PM