我希望Iformcollection
nopCommerce 4.0 中的数据获得空值。
这是我在控制器中的 post 方法
[HttpPost]
public ActionResult UpdateCart(int Id, IFormCollection form)
{
var setting = settingService.LoadSetting<DemoSetting>(_storeContext.CurrentStore.Id);
//Check plugin is enabled or not
if (!_setting.DemoSettingEnabled)
return Content("");
//Check null value
if Id,<= 0)
throw new ArgumentNullException("Id,");
这是我的视图页面,我可以从中发布数据
<form asp-controller="DemoDiscounts" asp-action="UpdateCart" asp-antiforgery="true"
asp-route-Id="@Model.Id" asp-route-id="product-attributes-form" >
您能否建议是否有人有解决方案?