I want data from Iformcollection
in nopCommerce 4.0 it getting null value.
This is my post method in controller
[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,");
This is my view page from which i can post data
<form asp-controller="DemoDiscounts" asp-action="UpdateCart" asp-antiforgery="true"
asp-route-Id="@Model.Id" asp-route-id="product-attributes-form" >
Can you please suggest if any one have solution?
Hey You can try this hope so it will helpful to you
Main thing you forgot Method="Post" and give id="product-attributes-form" role="form" hope so it can helpful to you