aspnetmvc-devexpress-dot-web-dot-mvc-dot-labelsettings-41193222.md
Gets or sets the name of an element that the Label is associated with.
Namespace : DevExpress.Web.Mvc
Assembly : DevExpress.Web.Mvc5.v25.2.dll
NuGet Package : DevExpress.Web.Mvc5
public string AssociatedControlName { get; set; }
Public Property AssociatedControlName As String
| Type | Description |
|---|---|
| String |
A string value corresponding to the element name.
|
Use the AssociatedControlName property to associate a control with the Label. On a web page, a browser renders the label as an HTML label element. The label’s “for” attribute is set to the associated control’s ID 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()
See Also