页面代码
<asp:Repeater ID="rep_message" runat="server">
                <HeaderTemplate>
                    <tbody>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr class="odd">
                        <td align="center">
                            <asp:TextBox ID="txtNo" runat="server" MaxLength="2" Style="width: 20px;" CommandName="お知らせSEQ"
                                Text='<%#Eval("INFO_SEQ") %>'></asp:TextBox>
                        </td>
                        <td align="center">
                            <asp:TextBox ID="txtDate" runat="server" MaxLength="10" Style="width: 70px;" CommandName="登録日付"
                                Text='<%#Eval("USER_ENTRY_YMD","{0:yyyy/MM/dd}")%>'></asp:TextBox>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtMessage" runat="server" Style="width: 570px;" CommandName="お知らせ内容"
                                Text='<%#Eval("INFO_NAIYO") %>'></asp:TextBox>
                        </td>
                        <td colspan="2">
                            <nobr>
                            <asp:TextBox ID="txtDateFrom" runat="server" MaxLength="10" style="width:70px;" CommandName = "表示期間(From)" 
                            Text = '<%#Eval("HYOJI_YMD_FROM","{0:yyyy/MM/dd}")%>'></asp:TextBox>
                            ~<asp:TextBox ID="txtDateTo" runat="server" MaxLength="10" style="width:70px;" CommandName = "表示期間(To)" 
                            Text = '<%#Eval("HYOJI_YMD_TO","{0:yyyy/MM/dd}") %>'></asp:TextBox>
                            </nobr>
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr class="even">
                        <td align="center">
                            <asp:TextBox ID="txtNo" runat="server" MaxLength="2" Style="width: 20px;" CommandName="お知らせSEQ"
                                Text='<%#Eval("INFO_SEQ") %>'></asp:TextBox>
                        </td>
                        <td align="center">
                            <asp:TextBox ID="txtDate" runat="server" MaxLength="10" Style="width: 70px;" CommandName="登録日付"
                                Text='<%#Eval("USER_ENTRY_YMD","{0:yyyy/MM/dd}") %>'></asp:TextBox>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtMessage" runat="server" Style="width: 570px;" CommandName="お知らせ内容"
                                Text='<%#Eval("INFO_NAIYO") %>'></asp:TextBox>
                        </td>
                        <td colspan="2">
                            <nobr><asp:TextBox ID="txtDateFrom" runat="server" MaxLength="10" style="width:70px;" CommandName = "表示期間(From)" Text = '<%#Eval("HYOJI_YMD_FROM","{0:yyyy/MM/dd}") %>'></asp:TextBox>~<asp:TextBox ID="txtDateTo" runat="server" MaxLength="10" style="width:70px;"  CommandName = "表示期間(To)" Text = '<%#Eval("HYOJI_YMD_TO","{0:yyyy/MM/dd}") %>'></asp:TextBox></nobr>
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <FooterTemplate>
                    </tbody>
                </FooterTemplate>
            </asp:Repeater>

解决方案 »

  1.   


    if(e.item.itemType==listItemType.item||e.item.itemType.AlternatingItem)
    {
    textbox tb=e.item.findControl("textbox1") as textbox;
    }
      

  2.   

    TextBox tb=Repeater1.Items[0].FindControl("TextBox1") as TextBox;
      

  3.   

    遍历repeater 的Item 用FindControl 这个方法
      

  4.   


     if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType ==ListItemType.Item)
                {
    textbox tb=e.item.findControl("textbox1") as textbox;}
      

  5.   

      protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
            {
                if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
                {
                    Repeater rp = e.Item.FindControl("Repeater2") as Repeater;
                    HiddenField hf = e.Item.FindControl("HiddenField1") as HiddenField;
                    HtmlTableCell tc = e.Item.FindControl("unit_cell") as HtmlTableCell;                if (rp != null)
                    {
                        DataSet ods = oContent.GetAllDynamicFromView("MODULE_ID='" + hf.Value + "' AND ISDELETE='0'", "");
                        rp.DataSource = ods.Tables[0];
                        rp.DataBind();
                        //if (ods.Tables[0].Rows.Count > 1)
                        //{
                        //    tc.RowSpan = ods.Tables[0].Rows.Count;
                        //}
                        rp.ItemCommand += new RepeaterCommandEventHandler(rp_ItemCommand);
                    }
                }
            }不懂什么意思,像这样写
      

  6.   

    不好意思 我没学过.net 这段代码看不懂
                /*if (e.Item.itemType == listItemType.item || e.item.itemType.AlternatingItem)
                {
                    textbox tb = e.item.findControl("txtNo") as textbox;
                }*/
    tb.
    我是说 这个 tb. 不出属性啊
      

  7.   

    /*if (e.Item.itemType == listItemType.item || e.item.itemType.AlternatingItem)
      {
      textbox tb = e.item.findControl("txtNo") as textbox;
    tb.
      }*/
      

  8.   

           protected void btnUpdate_Click(object sender, EventArgs e)
            {            
                 
            }
    是用这个e点出的 e.Item? 点不出 啊
      

  9.   


    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
     //这个是控件本身自带的方法.所以这里可以点出来的
    }
      

  10.   

    那你就直接这样找
    rep_message.Items[0].FindControl("txtNo") as TextBox;
    要保证rep_message.Items集合大于零
      

  11.   

    textbox 输入的时候让它自动生成 是TextBox 蓝色的  “txtNo”的值是你要取值的那个对话框的ID