Skip to main content

ASPxWebControl.CssPostfix Property

Gets or sets a CSS class name postfix that identifies style settings to be applied to the control.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web


public virtual string CssPostfix { get; set; }

Property Value

Type Default Description
String String.Empty

A String value that represents the required CSS class name postfix.


Use the CssPostfix property together with the ASPxWebControl.CssFilePath property in order to define a control’s custom appearance via a separate CSS file. The CssPostfix property specifies a postfix (a custom style explanatory text) that identifies CSS class names whose settings define the control’s appearance. The CSS class names specified by the postfix are intended to be contained within the CSS file, referred to by the ASPxWebControl.CssFilePath property. In order to apply the appearance provided by the specified CSS file’s settings, default class names within the file should be supplemented with a postfix defined via the CssPostfix property. Note that a class name and a postfix provided should be separated by the underline symbol - this is our internal requirement, which is required for parsing reasons.

Using postfixes solves the task of differentiating in a web browser, class names which define the same appearance settings of controls in different ways. If postfixes are not used, each separate CSS file contains classes with the same default names (as can be seen in a sample CSS file invoked by a click on the “View CSS Sample” command in an editor’s designer). In this case, a web browser cannot recognize and apply correct styles since all CSS classes are named identically within different CSS files.


When you set the CssPostfix property, you disable not only the default CSS styles, but the default sprites as well. The ASPxWebControl control does not allow you to mix the default CSS sprite with a custom CSS. To retain the default sprite CSS, copy its code to your own CSS file.

To learn more about CSS sprites, refer to CSS Image Sprites topic.

See Also