RadCaptcha in the Login widget: Implement the code of the custom Login widget

After you RadCaptcha in the Login widget: Implement the markup of the custom Login widget for the custom Login widget, you need to implement the code and logic behind the widget. The result is that when the user clicks the Forgot your password? link on the login screen, the captcha field is displayed and the character sequence, that the user enters, is validated.

To implement the required code, in your project, select the custom widget class. In this case, this is the CustomLoginControl.ascx.cs class.

EXAMPLE: For more information about the contents of the file, see the CustomLoginControl.ascx.cs in Sitefinity documentation-samples on GitHub.

When the user clicks the Forgot your password? link, the LostPasswordButton_Click event is initialized and the captcha panel is displayed. The ValidateCaptchaButton_Click checks whether the character sequence that the user enters is valid and hides the captcha panel. The rest of the logic, that is checking if the email address belongs to a registered user and sending the password recovery email, is handled by Sitefinity.

Next, you need to map in the backend the custom Login widget to the standard one.

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?