CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2001
    Posts
    31

    Accessing Label within ASP Repeater

    Hey guys,

    I was wondering how you would access the text of a label which is contained within an asp reapeater....

    for example,...

    Code:
    <asp:repeater id="level1" runat="server" datasource="....">
         <asp:repeater id="level2" runat="server" datasource="...">
              <asp:label id="lblText" runat="server">Text</asp:label>
         </asp:repeater>
    </asp:repeater>
    I read from somewhere that you would grab it in this fashion...
    Code:
    ctype(page.FindControl("level1:level2:ctl0:lblText"), Label).text
    but I get a "Object Not Instantiated" error.....

    Thanks in Advance
    Steven

  2. #2
    Join Date
    Oct 2001
    Posts
    31
    Sorry Guys,

    those greater than and less than sign messed up my post....
    this is what it's supposed to be

    Code:
    &lt;asp:repeater id="level1" runat="server" datasource="...."&gt;
         &lt;asp:repeater id="level2" runat="server" datasource="..."&gt;
             &lt;asp:label id="lblText" runat="server"&gt; Text &lt;asp:label&gt;
         &lt;/asp:repeater&gt;
    &lt;/asp:repeater&gt;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured