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.

Was this article helpful?