コード例 #1
0
        public static MvcCaptcha GetRegistrationCaptcha()
        {
            // create the control instance
            MvcCaptcha registrationCaptcha = new MvcCaptcha("RegistrationCaptcha");

            registrationCaptcha.UserInputClientID = "CaptchaCode";

            // all Captcha settings have to be saved before rendering
            registrationCaptcha.SaveSettings();

            return(registrationCaptcha);
        }
コード例 #2
0
ファイル: CaptchaHelper.cs プロジェクト: sol-hinata/Proyecto
    public static MvcCaptcha GetRegistrationCaptcha()
    {
        // create the control instance
        MvcCaptcha registrationCaptcha = new MvcCaptcha("RegistrationCaptcha");
        registrationCaptcha.UserInputClientID = "CaptchaCode";

        // all Captcha properties are set in this event handler
        registrationCaptcha.InitializedCaptchaControl +=
            new EventHandler<InitializedCaptchaControlEventArgs>(
                RegistrationCaptcha_InitializedCaptchaControl);

        // all Captcha settings have to be saved before rendering
        registrationCaptcha.SaveSettings();

        return registrationCaptcha;
    }