Problem is how do I find the qty control while in a listview in a web user control?
I tried a bunch of ideas and I just can't seem to figure it out. Any help would really be appreciated.
<tr>
<td>
<nopCommerce:NumericTextBox runat="server" ID="txtQuantity" Value="1" RequiredErrorMessage="<% $NopResources:Products.EnterQuantity %>"
RangeErrorMessage="<% $NopResources:Products.QuantityRange %>" MinimumValue="1"
MaximumValue="999999" Width="50" ValidationGroup="ProductDetails" />
</td>
<td>
<asp:Button runat="server" ID="btnAddToCart" OnCommand="btnAddToCart_Click" Text="<% $NopResources:Products.AddToCart %>"
ValidationGroup="ProductDetails" CommandArgument='<%# Eval("ProductId") %>' CssClass="productgridaddtocartbutton" />
</td>
</tr>
protected void btnAddToCart_Click(object sender, CommandEventArgs e)
{
if (Page.IsValid)
{
int productId = Convert.ToInt32(e.CommandArgument);
try
{
if (this.product != null && this.product.ViewOnly)
{
return;
}
//get the quantity of the product box field
int quantity = txtQuantity.Value;
int productVariantId = 0;
List<string> addToCartWarnings = null;
if (ProductManager.DirectAddToCartAllowed(productId, out productVariantId)
{
//pass obtained quantity instead of 1
addToCartWarnings = ShoppingCartManager.AddToCart(ShoppingCartTypeEnum.ShoppingCart,
productVariantId, string.Empty, decimal.Zero, quantity);
if (addToCartWarnings.Count == 0)
{
.....