title: Using FindControl to target a Literal
body: <p>I have a ListView called "orderReceiptTable" which I am able to properly access from the Code Behind. Within it is a literal called "orgName" which I obviously would like to populate with an organization's name.</p>
  
  <p>After much searching it was determined that FindControl was the right course of action. Perhaps I am using FindControl improperly but I am unable to actually have it "find" my Literal control.</p>
  
  <p>The code block is being called in the Page Load.</p>
  
  <p>My code looks as such:</p>
  
  <pre><code>    Dim orgNameString As String = getOrganizationName.getOrgName(organizationID).ToString()
  
      Dim myOrgName As Literal = FindControl("orgName")
      myOrgName = CType(orderReceiptTable.FindControl("orgName"), Literal)
  
      If Not (myOrgName Is Nothing) Then
          Response.Write("I found the control!")
          myOrgName.Text = orgNameString
      End If
  </code></pre>
  
  <p>Here is the mark-up in the .aspx file:</p>
  
  <pre><code>&lt;asp:ListView ID="orderReceiptTable" runat="server"&gt;
              &lt;LayoutTemplate&gt;
                  &lt;div runat="server" id="itemPlaceholder" /&gt;
              &lt;/LayoutTemplate&gt;
  
              &lt;EmptyDataTemplate&gt;
                  &lt;tr id="noDataDiv" runat="server"&gt; 
                      &lt;td class="sub" ID="itemPlaceholder" runat="server"&gt;
                          No order data was returned.
                      &lt;/td&gt;
                  &lt;/tr&gt; 
              &lt;/EmptyDataTemplate&gt;
  
              &lt;ItemTemplate&gt;
                  &lt;div id="itemPlaceholder" runat="server" style="border:solid 1px #000000; width:250px; float:left; padding:10px; border:solid 2px #1664B1;"&gt;
                      &lt;div&gt;Organization Name: &lt;asp:Literal runat="server" ID="orgName"&gt;&lt;/asp:Literal&gt;&lt;/div&gt;                             
                  &lt;/div&gt;
              &lt;/ItemTemplate&gt;        
      &lt;/asp:ListView&gt;   
  </code></pre>