title: Get LinkButton Embedded Label value
body: <p>Get LinkButton Embedded Label value?
  Also issue with LinkButton on postback comes back empty. 
  I basically need a clickable row to run a server side function is there a better way then a LinkButton?
  I'm basically creating a search dropdown.</p>
  
  <p>ASPX        </p>
  
  <pre><code>   &lt;asp:ListView ID="listView" runat="server" ShowFooter="true" AutoGenerateColumns="false"&gt;
                                  &lt;ItemTemplate&gt;
  
                                      &lt;asp:Repeater ID="SearchResults" OnItemCommand="SetValues_ItemCommand" runat="server"&gt;
  
                                          &lt;ItemTemplate&gt;
  
                                              &lt;div class="form-row"&gt;
  
                                                  &lt;asp:LinkButton ID="MemberInfo" runat="server" class="list-group-item list-group-item-action flex-column align-items-start mb-2" OnClick="MemberInfo_Click" CommandArgument='&lt;%# Container.ItemIndex %&gt;'&gt;
  
                                                      &lt;div class="col-lg-12 mb-2"&gt;
                                                          &lt;h5 class="mb-1"&gt;
                                                              &lt;asp:Label ID="PrimaryOrganization" runat="server" Text='&lt;%# Eval("PrimaryOrganization") %&gt;'&gt;&lt;/asp:Label&gt;
                                                          &lt;/h5&gt;
                                                      &lt;/div&gt;
  
                                                  &lt;/asp:LinkButton&gt;
  
                                              &lt;/div&gt;
  
  
                                          &lt;/ItemTemplate&gt;
  
                                      &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>CS</p>
  
  <pre><code>             protected void MemberInfo_Click(object sender, EventArgs e)
      {
  
          LinkButton MemberInfoBNT = (LinkButton)sender;
          bool bIsConverted = int.TryParse(MemberInfoBNT.CommandArgument.ToString(), out int index);
          if (bIsConverted)
          {
  
              Repeater SearchResultsObject = MemberInfoBNT.Parent.Parent as Repeater;
              ListViewDataItem listViewData = MemberInfoBNT.Parent.Parent.Parent as ListViewDataItem;
              int Listviewindex = listViewData.DataItemIndex;
  
  
              Label PrimaryOrganization = (Label)SearchResultsObject.Items[index].FindControl("PrimaryOrganization");
  
              TextBox registrantEmailValue = (TextBox)listView.Items[Listviewindex].FindControl("registrantEmail");
              registrantEmailValue.Text = PrimaryOrganization.Text;
  
          }
  
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/yPzfM.jpg" rel="nofollow noreferrer">Image of results</a></p>