How to access asp:label text property from code behind?
<p>I have a user control with a bunch of asp:label controls and I need to access their text property from the code behind. Is there an easy way to do this? I tried using the ID.Text of the label, with no luck.</p>

<p>Here is the ascx code:</p>

<pre><code>&lt;div id="labelContainer"&gt;
&lt;asp:Label ID="productDescription" class="productDescription fontCaps" runat="server"
    Text="express" /&gt;
&lt;br /&gt;
&lt;asp:Label ID="serviceDescription" class="serviceDescription fontCaps" runat="server"
    Text="express 24" /&gt;
&lt;div id="shipFrom"&gt;
    &lt;label class="font8 fontCaps" style="margin-left: 15px;"&gt;
        From:&lt;/label&gt;&lt;asp:Label ID="companyName" class="font8 fontCaps" Style="margin-left: 5px;"
            runat="server" Text="customer integration management" /&gt;
    &lt;label class="meeterLabel font8 fontCaps"&gt;
        MEETER:&lt;/label&gt;
    &lt;asp:Label ID="meeterNo" class="meeterNumber font8 fontCaps" runat="server" Text="34001" /&gt;
    &lt;br /&gt;
    &lt;div id="fromAddress"&gt;
        &lt;asp:Label ID="fromAddressLine1" class="font8 fontCaps" runat="server" Text="orbital park" /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="fromAddressLine2" class="font8 fontCaps" runat="server" Text="178-188 great west road" /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="fromTown" class="font8 fontCaps" runat="server" Text="hounslow" /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="fromCountry" class="font8 fontCaps" runat="server" Text="middlesex" /&gt;
        &lt;asp:Label ID="fromPostcode" class="font8 alignRight fontCaps" runat="server" Text="tw4 6js" /&gt;
    &lt;/div&gt;
    &lt;div id="toAddress"&gt;
        &lt;label class="font8 fontCaps"&gt;
            To:&lt;/label&gt;&lt;asp:Label ID="orgName" class="font10 addressTabs fontCaps" runat="server"
                Text="organisation name" /&gt;
        &lt;label class="font10  fontCaps" style="margin-left: 100px;"&gt;
            Tel: &amp;nbsp;&lt;/label&gt;&lt;asp:Label ID="phone" class="font10 fontCaps" runat="server" Text="0208 818 8000" /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="departmentName" class="font10 addressTabs2 fontCaps" runat="server"
            Text="department name" /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="toAddressLine1" class="font10 addressTabs2 fontCaps" runat="server"
            Text="address line 1" /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="toAddressLine2" class="font10 addressTabs2 fontCaps" runat="server"
            Text="address line 2" /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="toTown" class="font11 addressTabs2 fontCaps" runat="server" Text="town" /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="toCountry" class="font11 addressTabs2 fontCaps" runat="server" Text="county" /&gt;
        &lt;br /&gt;
        &lt;asp:Label ID="toPostcode" class="font11 addressTabs2 fontCaps" runat="server" Text="ub5 1aj" /&gt;
    &lt;/div&gt;
    &lt;div id="serviceCodeContainer" style="text-align: left;"&gt;
        &lt;div id="svcCode"&gt;
            &lt;label style="color: #fff; font-size: 11pt; font-family: Arial; font-weight: bold;
                vertical-align: text-top;"&gt;
                Handling:&lt;/label&gt;
            &lt;br /&gt;
            &lt;asp:Label ID="serviceCode" class="fontCaps" Style="margin-left: 18px; font-size: 18pt;"
                Text="STD" runat="server" /&gt;
        &lt;/div&gt;
        &lt;asp:Label ID="dayTime" class="fontCaps alignFarRight alignTop fontBold font11" runat="server" /&gt;
        &lt;asp:Label ID="pieceCount" Text="1/1" class="fontCaps pieceCountRight pieceCountTop fontBold font20"
            runat="server" /&gt;
        &lt;label class="font8 fontCaps"&gt;
            Shipment No:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/label&gt;&lt;asp:Label ID="shipmentNo"
                class="font8 fontCaps" runat="server" Text="123456" /&gt;
        &lt;br /&gt;
        &lt;label class="font8 fontCaps"&gt;
            Consignee Ref:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/label&gt;&lt;asp:Label ID="consigneeRef" class="font8 fontCaps"
                runat="server" Text="Your Customer Reference" /&gt;
        &lt;br /&gt;
        &lt;label class="font8 fontCaps"&gt;
            Consignor Ref:&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/label&gt;&lt;asp:Label ID="consignorRef" class="font8 fontCaps"
                runat="server" Text="Your Reference" /&gt;
    &lt;/div&gt;
    &lt;div style="text-align: center; margin-bottom: 5px;"&gt;
        &lt;asp:Label ID="serviceCentre" Style="padding-right: 60px;" class="font20 fontBold fontCaps"
            runat="server" Text="hayes" /&gt;
        &lt;asp:Label ID="hub" class="font20 fontBold fontCaps" runat="server" Text="hatfield" /&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
    &lt;div style="text-align: center; margin-bottom: 5px;"&gt;
        &lt;asp:Image ID="Image1" ImageUrl="~/images/barcode.jpg" runat="server" /&gt;
    &lt;/div&gt;
    &lt;div style="text-align: center; margin-top: 5px; margin-bottom: 5px;"&gt;
        &lt;asp:Label ID="routingCode" class="font8 fontBold fontCaps" runat="server" Text="2lgbub51aj+01000002" /&gt;
    &lt;/div&gt;
    &lt;div style="text-align: center;"&gt;
        &lt;asp:Image ID="licensePlateImg" ImageUrl="~/images/barcode2.jpg" runat="server" /&gt;
    &lt;/div&gt;
    &lt;div style="text-align: center; margin-top: 5px;"&gt;
        &lt;asp:Label ID="licensePlate" class="font8 fontBold fontCaps" runat="server" Text="(J)JD00 022 340 0100 0124" /&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p></p>

<p>But when I try to access it from the code behind of the user control, I get no Text property.</p>
