title: Making a specific label in a repeater visible after binding
body: <p>I'm trying to make a specific label in my repeater visible after binding.
  I don't want all the labels of every items in the repeater to be visible. Just the one where I click the button.
  When I click the button update I'm updating the information for my tourney item in my DB then I want to show a label to say the change was a success but only for the item I updated.</p>
  
  <p>Here's the code behind. The [...] is where I do the update in the DB</p>
  
  <pre><code>protected void repeatTourney_ItemCommand(object source, RepeaterCommandEventArgs e)  
             {  
                 if (e.CommandName == "btnUpdate_Click")  
                 {  
                     [...]
                     Label lblSuccess= (Label)e.Item.FindControl("lblUpdateSuccess");
                      bindRepeater(ddlEvents.Text);
                      lblSuccess.Visible = true;
                 }
             }
  </code></pre>
  
  <p>Here's the aspx. The [...] is the textboxes and other stuff that contains info for my DB item.</p>
  
  <pre><code>&lt;asp:Repeater ID="repeatTourney" runat="server" OnItemDataBound="repeatTourney_ItemDataBound"
                      OnItemCommand="repeatTourney_ItemCommand"&gt;
      &lt;ItemTemplate&gt;
          &lt;div class="form"&gt;
             [...]
              &lt;asp:Label ID="lblUpdateSuccess" runat="server" Text="Update success" Visible="false" /&gt;
              &lt;asp:Button ID="btnUpdate" runat="server" Text="Update" CssClass="button" CommandName="btnUpdate_Click" /&gt;
              [...]
          &lt;/div&gt;
       &lt;/ItemTemplate&gt;
   &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>In the end it should look like this</p>
  
  <pre><code>Item
   Info
   BtnUpdate
   lblSuccess.Visible = false
  
  Item
   Info
   BtnUpdate &lt;== Clicked
   lblSuccess.Visible = true
  </code></pre>
  
  <p>Thank you for any help provided.</p>
  
  <p>Edit : Here's my bindRepeater code</p>
  
  <pre><code> private void bindRepeater(string name)
          {
              List&lt;Tourney&gt; list = TourneyDAL.GetByNameEvent(name);
              [...]
              repeatTournois.DataSource = list;
              repeatTournois.DataBind();
              [...]
          }
  </code></pre>
  
  <p>Edit 2 :
  Thank you for the idea of an ID to tell which one need to be visible after the binding. </p>
  
  <p>Worked just fine. :)</p>
  
  <p>Here my new code</p>
  
  <pre><code>private void bindRepeater(string name, int index)
      {
          List&lt;Tourney&gt; list = TourneyDAL.GetByNameEvent(name);
          [...]
          repeatTourney.DataSource = list;
          repeatTourney.DataBind();
          [...]
          if (index != 0)
          {
              Label lblReussie = (Label)repeatTourney.Items[index].FindControl("lblUpdateSuccess");
              lblSuccess.Visible = true;
          }
  
  protected void repeatTourney_ItemCommand(object source, RepeaterCommandEventArgs e)  
         {  
             if (e.CommandName == "btnUpdate_Click")  
             {  
                 [...]
                 Label lblSuccess= (Label)e.Item.FindControl("lblUpdateSuccess");
                  bindRepeater(ddlEvenements.Text, e.Item.ItemIndex);
                  lblSuccess.Visible = true;
             }
         }
      }
  </code></pre>