如题,谢谢

解决方案 »

  1.   

    protected void rpt_ItemDataBound(object sender, RepeaterItemEventArgs e)
      {
      if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType==ListItemType.AlternatingItem)
      {   
      TextBox tb= e.Item.FindControl("tb") as TextBox ;
      tb.Text= "";
      }
      }
    var Repeater=document.getElementById("<%=Repeater.ClientID%>";
    var txt=Repeater.getElementsByTagName("input");
    for(var i=0;i<txt.length;i++)
    {
      alert(txt[i].value);
    }
    (sender as Control).NamingContainer.FindControl("TXT") as TextBox
      

  2.   

    这个用Jquery获取,首先要知道你repeater生成的HTML是啥,外面有几成DOM标记,然后用合适的选择器去获取就行。你给条件不够详细,无法准确回复
      

  3.   

    给TextBox一个Name属性aa比如这个TextBox得到焦点时  $("input[name='aa']").focus(function(){
        var a = $(this).attr("id");  //a就是这个TextBox的ID
    });  
      

  4.   


    <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
                    <ItemTemplate>
          <tr>
        <td style="height: 160px;width:200px; text-align: center;">
        <img src="<%#Eval("img") %>" height="120px" width="120px" alt="" />
        <br />
                            <asp:Label ID="Label1" runat="server" Height="17px" Width="120px" Text='<%#Eval("sname") %>'></asp:Label></td>
        <td style="height: 160px;width:200px;"> <asp:Label ID="Label8" runat="server" Height="17px" Width="120px" Text=""></asp:Label></td>
        <td style="height: 160px;width:100px; text-align: center;"><asp:Label ID="Label2" runat="server" Text='<%#Eval("yprice") %>'></asp:Label></td>
        <td style="height: 160px;width:100px; text-align: center;">     
        <asp:Label ID="Label3" runat="server" Text='<%#Eval("xprice") %>'></asp:Label>     
        </td>
        <td style="height: 160px;width:100px; text-align: center;">     
         <input type="text" id='ct<%#Eval("sid") %>' style="width:20px;" value='<%#Eval("count") %>' onchange="upd('<%#Eval("sid")%>')" />                      
                         <%--<span id='spc<%#Eval("sid")%>' ondblclick="show('<%#Eval("sid")%>')">
                         <%#Eval("count")%>
                         </span>--%>     
        </td>
        <td style="height: 160px;width:100px; text-align: center;"><%#Eval("f_sp_xiaoji") %></td>
        <td style="height: 160px"> <asp:Button ID="Button1" runat="server"  Text="删除" CommandName="del" />
        <a href="javascript:upd('<%#Eval("sid")%>')"><img src="images/background/updatecount1.gif" height="34px" width="115px" border="0" alt="" /></a>
                        </td>
          </tr>
      </ItemTemplate>
      </asp:Repeater>这个是代码。高手帮帮忙
      

  5.   

    ${"#Repeater1 input"}.attr("id")
    ${":text"}.attr("id")
    针对你的代码,这两个应该都可以。