private void PrepareCaptcha() { if (captchaPrepared) return; captcha = captcha ?? BXCaptchaEngine.Create(); captcha.MaxTimeout = 1800; captchaSrc = captcha.Store(); captchaHref = Encode(captchaSrc); captchaGuid = captcha.Id; captchaPrepared = true; }
protected void Submit_Click(object sender, EventArgs e) { bool success = Page.IsValid; if (success && RequireCaptcha) { captcha = BXCaptchaEngine.Get(Guid.Value); string error = captcha.Validate(CaptchaTextBox.Text); if (error != null) { Errors.AddErrorText(error); success = false; } } if (Submit != null) Submit(this, new SubmitEventArgs(success)); }