Hello,
I want to use captcha in my login page. I have username textbox and password textbox and loginbutton.
If the username or password was fail three times i want to show captcha image and then after tens time i want to disable user.
Any Suggestion?
1 Answer, 1 is accepted
0
Pero
Telerik team
answered on 22 Apr 2011, 06:31 AM
Hello Kham,
You should convert the Login control to template (Use smart tag at design time) and then place the RadCaptcha control inside the Login's control. Make sure the Captcha has the same ValidationGroup set as the Login Button.
Initially the RadCaptcha should have Visible="false" and Enabled="false".
You should handle the Login.LoginError event to count the times a user has failed to log in. If there are more than 3 times, the RadCaptcha's Visible and Enabled properties are set to true. Use Login.FindControl("RadCaptcha1") as RadCaptcha to find the Captcha control placed inside the Login control.
You should also handle the Login.LoggingIn event to test for the validity of RadCaptcha (RadCaptcha.IsValid). If the Captcha is not valid you should cancel the event.
I hope this helps.
Kind regards,
Pero
the Telerik team