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

To enhance the Login widget with a RadCaptcha, you first need to create a custom Login widget in your project in Visual Studio. You need to implement the widget's markup by adding a RadCaptcha field. This field is displayed to verify a sequence of characters before proceeding with the password retrieval.

To create the custom login widget:

  1. In Visual Studio, open your Sitefinity CMS project.
  2. In the project's context menu, select Add » New Item » Web User Control.
  3. Name the new widget CustomLoginControl.ascx.
  4. In the CustomLoginControl.ascx paste the widget markup.

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

This is the code of the regular Login widget with the addition of the <telerik:RadCaptcha> field. You implement the logic of the field in the respective .cs file - in this case, the CustomLoginControl.ascx.cs file.

The <asp:RegularExpressionValidator> field checks whether the value entered in the mailTextBox is a valid email address. In case the value entered is invalid, the ValidationGroup of this field prevents post backs to the server, that is, prevents the page to be refreshed.

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?