The anti-forgery token could not be decrypted

前端 未结 11 1214
萌比男神i
萌比男神i 2020-11-28 08:34

I have a form:

@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl })) {
@Html.AntiForgeryToken()
@Html.ValidationSummary()...

and a

11条回答
  •  萌比男神i
    2020-11-28 09:01

    I ran into this issue in an area of code where I had a view calling a partial view, however, instead of returning a partial view, I was returning a view.

    I changed:

    return View(index);

    to

    return PartialView(index);

    in my control and that fixed my problem.

提交回复
热议问题