captcha without textbox validation how?

2 posts, 0 answers
  1. Gaurav
    Gaurav avatar
    7 posts
    Member since:
    Jul 2011

    Posted 17 Aug 2011 Link to this post

    I am using Telerik captcha control without textbox and now i want to validate this with my own textbox value.

    my code is this

        <telerik:RadCaptcha ID="RadCaptcha" runat="server" EnableRefreshImage="true" CaptchaTextBoxCssClass="text"
                                                                        ProtectionMode="Captcha" Display="Dynamic" ErrorMessage="Invaid Code" CaptchaImage-TextColor="Black"
                                                                        CaptchaImage-RenderImageOnly="true" CaptchaImage-Width="219" CaptchaImage-TextChars="CustomCharSet"
                                                                        CaptchaImage-CharSet="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
                                                                        CaptchaImage-ImageCssClass="captchIMG" CaptchaImage-Height="36" CaptchaImage-BackgroundNoise="None"
                                                                        CaptchaImage-LineNoise="High" />

    and a single seperate text box for validate its value

        <asp:TextBox ID="txtCaptcha" runat="server" CssClass="text" />

    Now on button click event i want to validate this captcha text but how???
  2. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 18 Aug 2011 Link to this post

    Hi Gaurav,

    Please follow these suggestions in order to achieve the desired functionality:

    1. The property ValidationGroup of the RadCaptcha and the button, that triggers postback, should have the same value.

    2. The ValidatedTextBoxID property of RadCaptcha should be set to the ID of the TextBox which you want to be validated. This is demonstrated in the following online demo: http://demos.telerik.com/aspnet-ajax/captcha/examples/refreshimage/defaultcs.aspx.

    3. In the button's click event handler, you can use the IsValid property of RadCapthca to validate the input for the captcha. In this online demo you can check a scenario, in which the IsValid property is used.

    I would also suggest the Getting Started help article, which contains useful information on utilizing the RadCapthca control.

    You can find attached a sample page, implementing the desired functionality. Please use it as a base for your further development.

    Kind regards,
    Slav
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top