API Reference: PrefixAttribute Class

The PrefixAttribute can be applied to content model properties. The attribute sets a prefix label to be displayed as part of a single line editor, for example, a textbox or numeric editor. This can be used to provide extra information about the nature of the value to be entered, such as a currency symbol for financial values.

Applying the attribute to a property with an editor that doesn't support PrefixAttribute has no effect.


Decorate the model property with the PrefixAttribute. Pass the prefix label in the attribute constructor. The prefix can be an HTML-encoded string.


public class SampleContent: IContentType
    // Sets a euro symbol prefix to a numeric editor
    public int MonthlyRate { get; set; }

    // Sets a http scheme prefix to a textbox editor
    public string DomainName { get; set; }

    // ...