Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 如何更改reCAPTCHA错误消息?_Asp.net Mvc_Asp.net Mvc 3 - Fatal编程技术网

Asp.net mvc 如何更改reCAPTCHA错误消息?

Asp.net mvc 如何更改reCAPTCHA错误消息?,asp.net-mvc,asp.net-mvc-3,Asp.net Mvc,Asp.net Mvc 3,我想更改reCAPTCHA默认错误消息,该消息显示: 验证词不正确 我在本教程中安装了reCAPTCHA: 有什么帮助吗?转到AccountController.cs->Register method,只需修改以下内容: if (!captchaValid) ModelState.AddModelError("captcha", captchaErrorMessage); 为此: if (!captchaValid) ModelState.AddModelError("capt

我想更改reCAPTCHA默认错误消息,该消息显示:

验证词不正确

我在本教程中安装了reCAPTCHA:


有什么帮助吗?

转到AccountController.cs->Register method,只需修改以下内容:

if (!captchaValid)
    ModelState.AddModelError("captcha", captchaErrorMessage);
为此:

if (!captchaValid)
    ModelState.AddModelError("captcha", "whatever message you want to type");

转到AccountController.cs->Register方法,只需修改以下内容:

if (!captchaValid)
    ModelState.AddModelError("captcha", captchaErrorMessage);
为此:

if (!captchaValid)
    ModelState.AddModelError("captcha", "whatever message you want to type");

转到AccountController.cs->Register方法,只需修改以下内容:

if (!captchaValid)
    ModelState.AddModelError("captcha", captchaErrorMessage);
为此:

if (!captchaValid)
    ModelState.AddModelError("captcha", "whatever message you want to type");

转到AccountController.cs->Register方法,只需修改以下内容:

if (!captchaValid)
    ModelState.AddModelError("captcha", captchaErrorMessage);
为此:

if (!captchaValid)
    ModelState.AddModelError("captcha", "whatever message you want to type");

更好的方法是在视图中执行。 就这样,

<div class="editor-field">
  @Html.Raw(Html.GenerateCaptcha("captcha", "clean"))
  @Html.ValidationMessage("captcha", "Whatever message you want to type")
</div>

@Html.Raw(Html.GenerateCaptcha(“验证码”、“干净”))
@ValidationMessage(“验证码”,“您想键入的任何消息”)

更好的方法是在视图中执行。 就这样,

<div class="editor-field">
  @Html.Raw(Html.GenerateCaptcha("captcha", "clean"))
  @Html.ValidationMessage("captcha", "Whatever message you want to type")
</div>

@Html.Raw(Html.GenerateCaptcha(“验证码”、“干净”))
@ValidationMessage(“验证码”,“您想键入的任何消息”)

更好的方法是在视图中执行。 就这样,

<div class="editor-field">
  @Html.Raw(Html.GenerateCaptcha("captcha", "clean"))
  @Html.ValidationMessage("captcha", "Whatever message you want to type")
</div>

@Html.Raw(Html.GenerateCaptcha(“验证码”、“干净”))
@ValidationMessage(“验证码”,“您想键入的任何消息”)

更好的方法是在视图中执行。 就这样,

<div class="editor-field">
  @Html.Raw(Html.GenerateCaptcha("captcha", "clean"))
  @Html.ValidationMessage("captcha", "Whatever message you want to type")
</div>

@Html.Raw(Html.GenerateCaptcha(“验证码”、“干净”))
@ValidationMessage(“验证码”,“您想键入的任何消息”)