Back to Devexpress

SettingsBase.Attributes Property

aspnetmvc-devexpress-dot-web-dot-mvc-dot-settingsbase-b7f6f447.md

latest1.9 KB
Original Source

SettingsBase.Attributes Property

Gets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control.

Namespace : DevExpress.Web.Mvc

Assembly : DevExpress.Web.Mvc5.v25.2.dll

NuGet Package : DevExpress.Web.Mvc5

Declaration

csharp
public AttributeCollection Attributes { get; }
vb
Public ReadOnly Property Attributes As AttributeCollection

Property Value

Type
AttributeCollection

Property Paths

You can access this nested property as listed below:

Object TypePath to Attributes
MVCxFormLayoutItem

.NestedExtensionSettings .Attributes

|

Remarks

Example

For ASPxHyperLink:

csharp
@Html.DevExpress().HyperLink(settings => {
    settings.Name = "skipToMainContentLink";
    settings.Properties.Text = "Skip to Main Content";
    settings.ControlStyle.Font.Size = FontUnit.Parse("350%");
    settings.Theme = "Metropolis";
    settings.NavigateUrl = "javascript:void(0);";
    settings.Attributes["onclick"] = "MyDemo.focusMainElement();";
    settings.Attributes["onfocus"] = "MyDemo.toggleSkipLinks();";
    settings.Attributes["onblur"] = "MyDemo.toggleSkipLinks();";
}).GetHtml()

See Also

SettingsBase Class

SettingsBase Members

DevExpress.Web.Mvc Namespace