0
<asp:Repeater ID="Cartridges" runat="server" onitemcommand="Cartridges_ItemCommand">
<ItemTemplate>
<p class="cartqty">QTY <asp:TextBox ID="cartQty" Text="0" runat="server"></asp:TextBox></p>
<div class="cartbuy2"><asp:LinkButton ID="buy" runat="server" CommandName="AddtoCart" CommandArgument='<%#Eval("cartID") %>' Text="Buy"></asp:LinkButton></div>
</ItemTemplate>
</asp:Repeater>
爲什麼TextBox cartQty只返回默認值0而不是輸入和提交的值?如果我將值更改爲3,則無論輸入什麼內容,都會提交3。ASP.Net C#asp:TextBox Only'默認值通過
下面是cartQty
代碼隱藏LinkButton lb = (LinkButton)e.CommandSource;
int varCartQty = Convert.ToInt32(((TextBox)lb.Parent.FindControl("cartQty")).Text);
謝謝;-)