首页 > 解决方案 > 将 AntiForgeryToken 从控制器传递到控制器

问题描述

有没有办法将 AntiForgeryToken 从控制器传递到控制器?

PA控制器

[HttpPost]
[ValidateAntiForgeryToken]
    public ActionResult Cancel()
    {
        var result = MvcApplication.API.CancelPaymentPlan(LoginToken);
        if (result.ResultID == 0)
        {
            AccountDetails = null;
            return RedirectToAction("Index", "Home");
        }
        else
            return PartialView("_GeneralErrorPartialView", result);
        
    }

家庭控制器

[ValidateAntiForgeryToken]
public ActionResult Index()
{
    return View();
}

标签: asp.net-mvcmodel-view-controller

解决方案


推荐阅读