【发布时间】:2020-06-28 07:04:56
【问题描述】:
以下是我在控制器中的操作。我需要将ProductId 和Quantity 传递给过滤器SessionCheck。除了TempData,还有其他办法吗?
[SessionCheck]
[HttpPost]
public ActionResult AddToCart(int ProductId, int Quantity)
{
try
{
//my code here
return RedirectToAction("Cart");
}
catch (Exception error)
{
throw error;
}
}
以下是我的操作过滤器:
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
// my code here
}
【问题讨论】:
标签: c# asp.net-mvc session tempdata custom-action-filter