开发者

Recaptcha ErrorMessage

开发者 https://www.devze.com 2023-04-06 11:43 出处:网络
I\'m using the Recaptcha control in asp.net web forms. And i\'ve faced with the problem about ErrorMessage. How to:

I'm using the Recaptcha control in asp.net web forms. And i've faced with the problem about ErrorMessage. How to:


If you grab the latest source code you should find examples in dotnet/test folder.

ErrorMessage can be set through CustomTranslations property like here: recaptcha-plugins/dotnet/test/CustomTranslation.aspx.cs

    protected void Page_Init(object sender, EventArgs e)
    {

        var customTranslation = new Dictionary<string, string>();
        customTranslation.Add("instructions_visual", "Scrivi le due parole:");
        customTranslation.Add("incorrect_try_again", "Scorretto. Riprova.");

        RecaptchaControl.CustomTranslations = customTranslation;

    }

The ErrorMessage will be automatically displayed in a ValidationSummary because RecaptchaControl implements IValidator interface.

0

精彩评论

暂无评论...
验证码 换一张
取 消