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

using captcha in loginpage

1 Answer 82 Views
Captcha
This is a migrated thread and some comments may be shown as answers.
kham
Top achievements
Rank 1
kham asked on 21 Apr 2011, 04:14 AM
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

Sort by
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

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.

Tags
Captcha
Asked by
kham
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or