This is a migrated thread and some comments may be shown as answers.

CAPTCHA shows valid even when empty

2 Answers 155 Views
Captcha
This is a migrated thread and some comments may be shown as answers.
Tracy
Top achievements
Rank 1
Tracy asked on 27 Jul 2012, 03:31 PM
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 Answers, 1 is accepted

Sort by
0
Tracy
Top achievements
Rank 1
answered on 31 Jul 2012, 04:19 PM
Anyone! Please!
0
Accepted
Slav
Telerik team
answered on 01 Aug 2012, 12:25 PM
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.
Tags
Captcha
Asked by
Tracy
Top achievements
Rank 1
Answers by
Tracy
Top achievements
Rank 1
Slav
Telerik team
Share this question
or