I'm using a third party control called an Accordion from Juice UI. Within that control, I have a table with labels.
VB.NET Code:
<juice:Accordion ID="accSwrlHddRepl" runat="server"> <juice:AccordionPanel runat="server" Title="HDD Information"> <PanelContent> <p> <table style="width: 99%;"> <tr> <td class="style2"> <asp:Label ID="Label2111111" runat="server" Text="Original HDD:"></asp:Label> </td> <td> <asp:Label ID="lblOriginalHDD" runat="server" Text="N/A"></asp:Label> </td> </tr> <tr> <td class="style2"> <asp:Label ID="Label16666666" runat="server" Text="First HDD Replacement:"></asp:Label> </td> <td> <asp:Label ID="lblFirstHddReplacement" runat="server" Text="N/A"></asp:Label> </td> </tr> <tr> <td class="style2"> <asp:Label ID="Label39876" runat="server" Text="Second HDD Replacement:"></asp:Label> </td> <td> <asp:Label ID="lblSecondHddReplacement" runat="server" Text="N/A"></asp:Label> </td> </tr> </table> </p> </PanelContent> </juice:AccordionPanel> <juice:AccordionPanel runat="server" Title="Replace HDD(s)"> <PanelContent> </PanelContent> </juice:AccordionPanel> <juice:AccordionPanel runat="server" Title="SWRL Letter"> <PanelContent> </PanelContent> </juice:AccordionPanel> </juice:Accordion>
I can't access the label directly, so I'm trying to use the FindControl method to get it and set it's text property.
VB.NET Code:
CType(Me.accSwrlHddRepl.FindControl("lblFirstHddReplacement"), System.Web.UI.WebControls.Label).Text = "string"
But I get a NullReferenceException. So I moved the label outside of the table and put it just inside the accordion. The same behavior occurs. Then I gave the accordion panel an ID and did FindControl there, but the same issue occurs.
So I'm a little confused here.
Anyone have any ideas?




Reply With Quote