
.csHtml Code
@model IEnumerable
Layout = "~/Views/Shared/_Site.cshtml";
ViewBag.Title = "Product";
}
@using ( Html.BeginForm("SaveQuantity","Products"))
{
Code | Product Name | Unit Price | Qty |
@item.ProductCode | @item.ProductName | @item.Price | @Html.TextBox("txtProductQty") |
}
Controller Code
[HttpPost]
public ActionResult SaveQuantity(FormCollection formCollection)
{
foreach (var key in formCollection.Keys)
{
var value = formCollection[key.ToString()];
// etc.
}
return View();
}

Riyaz AkhtarPosted Jul 23, 2013, 1:34 AM
.csHtml Code
Controller Code
Jignesh TrivediPosted Jul 22, 2013, 11:14 PM
Do one thing, first of provide css class name to your textbox.
now when click of button collect information using JQuery.
@Html.TextBox("txtProductQty", null, new { @class = "textbox" } );
$(".textbox").each(function() {
// Value fill into string array..
});
now this array pass to controller using $.post or $.ajax method.
hope this will help you.
Iftikar HussainPosted Jul 22, 2013, 9:40 AM
Try like this, you will get all quantity value as a coma separated
Regards,
Iftikar