CAPTCHA shows valid even when empty

3 posts, 1 answers
  1. Tracy
    Tracy avatar
    4 posts
    Member since:
    Jul 2012

    Posted 27 Jul 2012 Link to this post

    Hello,

    I added a rad captcha control, a button and  the "validationgroup" to each of the controls to a page that has nothing else.

    On Page Load I added the following code:
            If RadCaptcha1.IsValid Then
                Response.Write("Valid")
            Else
                Response.Write("NOT VALID")
            End If

    I get "Valid" when the page loads and there is no text in the captcha textbox.

    what am I missing?

    Please help - thank you.
  2. Tracy
    Tracy avatar
    4 posts
    Member since:
    Jul 2012

    Posted 31 Jul 2012 Link to this post

    Anyone! Please!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Slav
    Admin
    Slav avatar
    1356 posts

    Posted 01 Aug 2012 Link to this post

    Hi Tracy,

    The isValid property of RadCaptcha is usually used in the server-side event handler of a control that postbacks and causes validation. In your case this is the button control and you can use its click event handler as shown in this online demo.

    If you want to check if the RadChaptcha is validated on Page_Load, you should call its method Validate() before performing the check:
    RadCaptcha1.Validate()
    If RadCaptcha1.IsValid Then
        Response.Write("Valid")
    Else
        Response.Write("NOT VALID")
    End If


    Greetings,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top