我正在尝试将 6 个值从 6 个不同的文本框中发送到控制器。我如何在不使用 JavaScript 的情况下做到这一点?
@using (Html.BeginForm("Save", "Admin"))
{
@Html.TextBox(ValueRegular.ToString(FORMAT), new { @name = "PriceValueRegularLunch" })
@Html.TextBox(ValueRegular1.ToString(FORMAT), new { @name = "PriceValueRegularLunch1" })
@Html.TextBox(ValueRegular2.ToString(FORMAT), new { @name = "PriceValueRegularLunch2" })
<input type="submit" name="SaveButton" value="Save" />
}
[HttpPost]
public ActionResult SavePrices(int PriceValueRegularLunch)
{
return RedirectToAction("Lunch", "Home");
}