Create the editor view

After you create the evaluater class, you create the editor view that you use to enter the criterion value when editing a user segment in Sitefinity’s CMS backend. This view consists of a dropdown field and client side validation. To create the view:

  1. In Visual Studio, open the context menu of the DayOfWeekPersonalization project and click Add » Class
  2. Name the class file DayOfWeekEditor.ascx and click Add.
  3. From the context menu of the file, select Properties.
  4. Set the Build Action to Embedded Resource.
  5. Open the newly created file and clear its contents.
  6. Paste the following code:

    In the code above, you create a dropdown field that is used to configure the value for the criteria of your custom personalization. The script tag contains logic that is used to persist the value to and from the client side, as well as for input validation. The curly brackets dollar notation is used the retrieve resources from the CustomPersonalizationResources class.

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?