Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
155
Adding WebCaptcha dynamically in own WebControl
posted

Hey Guys!

I've a Problem with adding the WebCaptcha in my own created WebControl!

           private Infragistics.Web.UI.EditorControls.WebCaptcha _captcha;

           [...]

            this._captcha = new Infragistics.Web.UI.EditorControls.WebCaptcha()
                {
                    //CaptchaDictionaryMode = Infragistics.Web.UI.EditorControls.CaptchaDictionaryMode.Off,
                    //ProtectionMode = Infragistics.Web.UI.EditorControls.ProtectionMode.InvisibleInputField,
                    EnableEmbeddedJavaScript = true,
                    ErrorMessage = "Falsche Eingabe!",
                    ID = "WebCaptcha1",
                };

            this._captcha.SubmitButton.Visible = false;
            this._captcha.RefreshButton.Visible = true;
            this._captcha.AudioButton.Visible = true;

            this._captcha.CaptchaImageSettings.TextColor = System.Drawing.Color.DarkGray;
            this._captcha.CaptchaImageSettings.LinesNoise = Infragistics.Web.UI.EditorControls.NoiseLevel.VeryLow;
            this._captcha.CaptchaImageSettings.FontWarping = Infragistics.Web.UI.EditorControls.NoiseLevel.Low;
            this._captcha.CaptchaImageSettings.FontSize = 25;
            this._captcha.CaptchaImageSettings.TextLength = 5;
            this._captcha.CaptchaImageSettings.EnableUniqueChars = false;

            this._captcha.InputValueEditor.ID = "_editor";
            this._captcha.InputValueEditor.Width = Unit.Pixel(173);

            this.Controls.Add(this._captcha);

So now my Problem is, that this Capture dont show a Picture or the Audio/Refresh Button! I've only the Textbox!
If i've added the Capture in the normal Page.cs File it works.. so only in my own Control is this httpHandler missing or something like that!
He cant find this "WebCaptchaImage.axd".

Hope there is a Solution for this Problem..

Thx
Inoir

Parents
No Data
Reply
  • 33839
    posted

    Hi Inoir,

    Have you registered the image handler in the web.config?  This is normally done by the captcha at the design view.  But if its designer isn't used, this will not happen automatically.  So you'll need to do it manually.

    <httpHandlers>
    <add path="WebCaptchaImage.axd" verb="GET,HEAD" type="Infragistics.Web.UI.EditorControls.CaptchaImageHandler"
    validate="true" />
    </httpHandlers>

    regards,

    David Young

Children