Hi,

I have the following code that has transformed the Quantity box on the Product page to a Dropdown,
var maxQty = 1000;
var selectList1 = new List<SelectListItem>(maxQty + 1);
for (var i = 0; i <= maxQty; i++)
{
    selectList1.Add(new SelectListItem { Text = i.ToString(), Value = i.ToString() });
}
@Html.DropDownListFor(model => model.EnteredQuantity, selectList1, new { @class = "qty-input" })

But I would like,
var maxQty = 1000;

to only go as high as,
var maxQty = StockQuantity;

Any ideas?

Cheers,

Mike.