我有一个用户控件内的中继器。页面上的用户控件shoppingcart.aspx.I想要从javascript中获取所有lblPrice .aspx。如何访问所有这些标签。中继器内的访问标签在asp.net页面内的用户控件内的ItemTemplate
<asp:Repeater ID="rptShoppingCart" runat="server">
<HeaderTemplate>
<tr class="big_header_style">
<td>
Product(s)
</td>
<td>
Description</td>
<td>
Quantity</td>
<td>
Price (INR)</td>
<td>
Total (INR)</td>
<td>
Remove?</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr class="dg_item_style">
<td align="center">
<img src='<%# Page.ResolveUrl(Convert.ToString(DataBinder.Eval(Container.DataItem,"ProductInfo.thumbnailPath1")))%>'
width="90" height="90" /></td>
<td>
<asp:Label ID="lblProductName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"ProductInfo.productName") %>'></asp:Label></td>
<td align="center">
<input id="proQuantity" runat="server" type="text" size="1" value='<%#Eval("Quantity") %>' /></td>
<td align="center">
<strong class="redtxt">
<asp:Label ID="lblPrice" runat="server" Text='<%#GetPrice((BAL.ShoppingCartMaster)Container.DataItem)%>' /></strong></td>
<td align="center">
<strong class="redtxt">
<asp:Label ID="lblTotal" runat="server" Text='<%#calculatePrice((BAL.ShoppingCartMaster)Container.DataItem)%>'></asp:Label></strong>
</td>
<td align="center">
<asp:CheckBox runat="server" ID="cbRemoveFromCart" />
<asp:Label id="lblShoppingCartID" runat="server" visible="false" text='<%#Eval("ShoppingCartID") %>'></asp:Label>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
对不起,不使用jQuery和不使用母版页。 – Rohit 2009-09-15 09:20:48
然后你可以使用ClientId属性。 – Mahin 2009-09-15 09:42:07
不,您不能在Repeater内部使用ClientID作为控件。 – 2009-12-01 08:31:46