title: Handling the checkedchanged event of inner repeater Checkbox control in asp.net nested repeaters
body: <p>I have nested repeaters on my aspx page.In the outer repeater I am displaying a list of products and in the inner repeater I am displaying a list of additional options associated with each product.The inner repeater contains a checkbox,textbox,label and other stuff.I would like to find the controls inside the outer repeater when a user selects a checkbox in the inner repeater.In order to handle this I am using the following code.</p>
  
  <pre><code>&lt;asp:Repeater ID="OuterRepeater" runat="server" 
          onitemdatabound="OuterRepeater_ItemDataBound" &gt;
          &lt;ItemTemplate&gt;
      &lt;asp:Label ID="CodeLabel" runat="server" Text='&lt;%# Eval("Code") %&gt;'&gt;&lt;/asp:Label&gt;
       &lt;asp:Repeater ID="InnerRepeater" runat="server" OnItemCreated="InnerRepeater_ItemCreated"&gt;
         &lt;ItemTemplate&gt;
      &lt;asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true"/&gt; 
      &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt; 
        ......
        .......
      &lt;/ItemTemplate&gt;
      &lt;/asp:Repeater&gt;
       ......
        ......
      &lt;/ItemTemplate&gt;
      &lt;/asp:Repeater&gt;
  
  
   protected void InnerRepeater_ItemCreated(object sender, RepeaterItemEventArgs e)
          {
              RepeaterItem ri = (RepeaterItem)e.Item;
  
              if (ri.ItemType == ListItemType.Item || ri.ItemType == ListItemType.AlternatingItem
              )
              {
                  CheckBox cb = ri.FindControl("CheckBox1") as CheckBox;
                  cb.CheckedChanged += new EventHandler(CheckBox1_CheckedChanged);
              }
          }
  
  private void CheckBox1_CheckedChanged(object sender, EventArgs e)
          {          
  
              CheckBox cb = (CheckBox)sender;
              if (cb.Checked)
              {
                  //do something
              }
              else
              {
                //do something
              }
          }
  </code></pre>
  
  <p>But the checkedChanged event of the checkbox is not firing for some reason.Also I am not sure how to access the textbox of the outer repeater in the checked changed event of the innter repeater checkbox control.</p>
  
  <p>Could someone please help me with this?</p>
  
  <p>Thanks</p>