<asp:Repeater ID="Repeater1" runat="server">
                                <ItemTemplate>
                                  <tr>
                                    <td class="TxtBox" align="left">
                                        <asp:TextBox ID="Cont1" Columns="70" TextMode="MultiLine" CssClass="InputStyle" runat="server"></asp:TextBox>
                                   </td>
                                  </tr>
                                </ItemTemplate>
                              </asp:Repeater>
<asp:Button ID="Button1" runat="server" Text="Save" OnClick="Button1_Click" />当Button1 click 的时候,取出所有 TextBox 的值

解决方案 »

  1.   

    foreach遍历所有行,遍历到某一行时,使用FindControl方法找到控件取值
      

  2.   

       Repeater re=new Repeater();//改成你的
                RepeaterItemCollection ric=re.Items;
                ArrayList al = new ArrayList();
                foreach (RepeaterItem ri in ric)
                {
                    TextBox tb = ri.FindControl("Cont1") as TextBox;
                    //做些事件;
                    //比如说拼个数组
                }
      

  3.   


    string textBoxValues="";
    for (int i = 0; i < this.rpt.Items.Count; i++)            
    {
              TextBox tB = (TextBox )this.Repeater1.Items[i].FindControl("Cont1");    
                if (tB.Text!=null)                                   
                {
                    textBoxValues +=tB.Text.Tostring();
               }
    }