2017-07-16 140 views
0

我在一个视图中有两种形式,其中一种形式中包含<recaptcha/>标记,另一种形式没有。尝试提交没有验证码的表单会被其他表单中的验证码阻止,然后声明未验证的错误消息。在一种形式的Recaptcha阻止另一种形式

我使用的NuGet包:PaulMiami.AspNetCore.Mvc.Recaptcha,.NET 1.1核心

<form method="post" asp-controller="Account" asp-action="Register" asp-route-returnurl="@ViewData["ReturnUrl"]"> 

... 

<div> 
    <div> 
     <button type="submit">Submit</button> <!-- Hitting this button, triggers the recaptchaErrorMessage to fire and block. --> 
    </div> 
</div> 
</form> 

<form asp-controller="Contact" asp-action="SendMessage"> 

... 

<div> 
    <recaptcha/> 
    <span id="recaptchaErrorMessage"></span> 
    <button type="submit">Submit</button> 
</div> 
</form> 

回答

1

这是一个错误,它是固定在版本1.2.1,请更新:

dotnet add package PaulMiami.AspNetCore.Mvc.Recaptcha --version 1.2.1