Skip to main content
A newer version of this page is available. .

Label Main Features

  • 2 minutes to read

The Label extension allows you to display text in a specified location on a web page.

MVC_Label_MainFeatures

The Label offers the following features.

  • Ability to Associate a Label to an Extension

    You can specify an extension with which the Label extension is associated. In this case, the label renders as an HTML label element, with the for attribute set to the Name property of the associated extension. Label attributes can be used to extend the functionality of the associated extension. You can define an associated extension with the LabelSettings.AssociatedControlName property.

    @Html.DevExpress().Label(
    settings => {
        settings.ControlStyle.CssClass = "label";
        settings.Text = "Product Name:";
        settings.AssociatedControlName = "ProductName";
    }).GetHtml()
    
    @Html.DevExpress().TextBox(
        settings => {
            settings.Name = "ProductName";
            settings.ControlStyle.CssClass = "editor";
        }
    ).Bind(Model.ProductName).GetHtml()
    
  • Appearance Customization

    The Label appearance can be customized in different ways: by applying DevExpress built-in themes, by specifying CSS classes or by using different label appearance properties (for example, using the LabelSettings.Properties.Style property).

    See this topic to learn more about appearance customization using predefined built-in visual themes: Applying Themes.

  • Full-Featured Client-Side API

    The Label provides you with a comprehensive client-side API. This API is implemented using JavaScript and is exposed via the ASPxClientLabel object. The ASPxClientLabel object serves as a client-side equivalent of the Label extension.