public RecaptchaHtmlHelper(string publicKey, string hl, CaptchaTheme theme, CaptchaType type, string callback, string expiredCallback) { PublicKey = RecaptchaKeyHelper.ParseKey(publicKey); Hl = hl; Theme = theme; Type = type; Callback = callback; ExpiredCallback = expiredCallback; if (string.IsNullOrEmpty(publicKey)) { throw new InvalidOperationException("Public key cannot be null or empty."); } }
public static IHtmlString Recaptcha(this HtmlHelper htmlHelper, string publicKey = "[reCaptchaPublicKey]", string hl = "en", CaptchaTheme theme = CaptchaTheme.Light, CaptchaType type = CaptchaType.Image, string callback = "", string expiredCallback = "") { var recaptchaHtmlHelper = new RecaptchaHtmlHelper(publicKey, hl, theme, type, callback, expiredCallback); return(htmlHelper.Raw(recaptchaHtmlHelper.ToString())); }
/// <summary> /// Define a theme for captcha. /// </summary> public Captcha Theme(CaptchaTheme theme) { _theme = theme; return this; }
public GoogleCaptchaConfig(CaptchaTheme theme) { Theme = theme; }