我有一个结构像这样的中继器
<asp:Repeater ID="RpAccBind" runat="server" OnItemDataBound="RpAccBind_ItemDataBound">
<ItemTemplate>
<tr id="acsryRow" runat="server">
<td data-th="Product">
<div class="prodImgMain">
<img src="../instrumentimages/<%# Eval("ProductImage") %>" alt="<%# Eval("ProductName")%>" />
</div>
</td>
<td data-th="Description">
<div class="prodDescriptionContainer">
<ul>
<li>
<span class="prdRow"><%# Eval("ProductName") %></span>
</li>
</ul>
</div>
<div class="quantityIconWrap form-group">
<span class="number-wrapper">
<asp:TextBox Text='<%# Eval("Quantity") %>' ID="txtqty" CssClass="form-control" runat="server" size="3" Width="50" onkeyup="this.value=this.value.replace(/[^0-9]/g,'');" OnTextChanged="txtQtyTextChanged" AutoPostBack="true"></asp:TextBox>
</span>
<span>
<asp:ImageButton ID="lnkAscRemove" runat="server" class="btn" OnClick="lnkRemoveClick" CommandArgument='<%# Eval("ProductId")%>' ImageUrl="../images/deleteIcon.png"></asp:ImageButton>
</span>
</div>
</td>
<td data-th="Amount" style="padding-right: 5%;">
<div class="amountColMain">
<ul>
<li><span><strong><span id="litConPrice" runat="server">$<%# Eval("ConsumerPrice") %></span></strong></span></li>
</ul>
</div>
</td>
<td></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</FooterTemplate>
</asp:Repeater>
现在,每当 txtQty 为 0 时,我都希望点击 imagebutton 的 productid。现在,我正在使用类似的东西
long productId = Convert.ToInt64(((ImageButton)((RepeaterItem)txtQty.Parent).FindControl("lnkAscRemove")).CommandArgument);
它给了我一个无法将HtmlTableCell转换为RepeaterItem的错误
任何帮助将不胜感激。提前致谢