Recaptcha ErrorMessage
I'm using the Recaptcha control in asp.net web forms. And i've faced with the problem about ErrorMessage. How to:
- Set E开发者_StackOverflowrrorMessage for it?
- Show (hide) the ErrorMessage if the Recaptcha is (isn't) valid?
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.
精彩评论