aspnetmvc-8989-components-data-editors-extensions-label.md
Label is a label extension that allows you to display text on a web page.
Label is a LabelExtension class instance. The ExtensionsFactory.Label helper method allows you to add a Label extension to a view. This method’s parameter provides access to the Label ‘s settings (LabelSettings).
The ASPxClientLabel object is a Label ‘s client counterpart.
Note
Use the Overview - LabelFor extension to specify a label element’s for attribute.
The following code snippets illustrate how to add a Label to a view:
@Html.DevExpress().Label(settings => {
settings.Name = "label1";
settings.Text = "Some text";
settings.Properties.EnableClientSideAPI = true;
}).GetHtml()
@Html.DevExpress().Button(settings => {
settings.Name = "myButton1";
settings.ClientSideEvents.Click = "function (s, e) {label1.SetText(label1.GetText() + ' New text');}";
}).GetHtml()
Note
The Partial View should contain only the extension’s code.
The image below shows the result.
Ability to Associate a Label to an Extension
Appearance Customization
Full-Featured Client-Side API