asp.net-mvc - 将 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();
}
解决方案
推荐阅读
- webpack - Webpack 5 不能重用不同文件结构中的缓存
- flutter - Flutter 在后台运行 Dart 功能
- express - 是否可以在 pug 和 expressjs 中参数化布局路径?
- python - 谷歌数据流作业成本优化
- laravel - 仅当验证链接粘贴在用户登录的选项卡中时,Fortify 电子邮件验证才有效
- python-3.x - 当函数通过在单独的线程中按下控制台键自行运行时中断
- wordpress - 将相同的样式应用于 Oxygen Builder 中的可编辑块
- python - ValueError:数据基数不明确:x 大小:10 y 大小:1 请提供具有相同第一维的数据
- python - InvalidArgumentError:断言失败:[标签必须是 <= n_classes - 1] [条件 x <= y 没有按元素保持:] [x (head/losses/Cast:0) = ]
- swift - 如何等到 UIView 转换结束