title: How to FindControls in repeater control?
body: <p>I want  to enable or disable 'ParticipateBtn' depending on EventStartDate. I am getting this error:Object reference not set to an instance of an object. </p>
  
  <p>
              
                  Start Date : 
                  &lt;%# CheckEnability((DateTime)Eval("Event_Start_Date")) %>
              </p>
  
  <pre><code>        &lt;asp:Button runat="server" 
              ID="ParticipateBtn" 
              CommandName="Participate" 
              CommandArgument='&lt;%# Eval("Event_Id") + "|" + Eval("Event_Name") + "|" + Eval("Volume") + "|" + Eval("Tournament_Id") %&gt;' 
              Text="Participate" /&gt;&amp;nbsp;&amp;nbsp;
  
      &lt;/ItemTemplate&gt;
  
      &lt;FooterTemplate&gt;&lt;/FooterTemplate&gt;
  
      &lt;SeparatorTemplate&gt;
          &lt;hr style="color:Silver; height:1px;" /&gt;
      &lt;/SeparatorTemplate&gt;
  
  &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>The code behind...</p>
  
  <pre class="lang-cs prettyprint-override"><code>//Code behind
  protected  string CheckEnability(DateTime eventstartdate)
  {
  
      if (eventstartdate.Date &lt; DateTime.Now.Date)
      {
          Button btn = (Button)Repeater1.FindControl("ParticipateBtn");
          btn.Enabled = false;              
      }           
      return eventstartdate.ToString("yyyy-MM-dd");
  }
  </code></pre>