由于另一个表单内的表单导致 AntiForgery MachineKey 错误? MVC4

AntiForgery MachineKey error due to form inside another form? MVC4

是否有可能由于一个表单包含另一个表单而导致 Antiforgery MachineKey 错误?

The anti-forgery token could not be decrypted. If this application is hosted by a Web Farm or cluster, ensure that all machines are running the same version of ASP.NET Web Pages and that the configuration specifies explicit encryption and validation keys. AutoGenerate cannot be used in a cluster.

当我单独放置表单时,两者都有效,但是当我在两者上都遇到上述错误时,我是网络开发的新手,所以这可能是一个愚蠢的问题(表单内的表单)。

@using (Html.BeginForm()) {
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
// ...
    @using (Html.BeginForm("miniCreate", "Client"))
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)
        //...
    }
}

正如@MikeSmithDev 所提到的,您不能将一个表单放在另一个表单中。一种替代方法是 AJAX 控制器的迷你表单。或者放在大表外面用CSS做成"look right".