Mandatory property for a widget - Kentico 12 MVC

Alireza Arifi asked on June 14, 2019 19:16

I was wondering how I can make a property mandatory in the widget's configuration dialog on pagebuilder. For example I want to make value 1 mandatory in the code below:

public class NumberWidgetProperties : IWidgetProperties
    {
        [EditingComponent(IntInputComponent.IDENTIFIER, Order = 0, Label = "value 1")]
        public int FirstValue { get; set; };
        [EditingComponent(TextInputComponent.IDENTIFIER, Order = 1, Label = "value 2")]
        public string SecondValue { get; set; };
    }

The default value can be edited on configuration dialog box and I do not want the user be able to remove the value.

Recent Answers


Anil Bandela answered on June 18, 2019 13:59

Make a use of hidden value concept or auto generated default value on submitting a "FORM"

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.