Back to Devexpress

ASPxFileManager.CssPostfix Property

aspnet-devexpress-dot-web-dot-aspxfilemanager-62e64ba7.md

latest3.5 KB
Original Source

ASPxFileManager.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.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public override string CssPostfix { get; set; }
vb
Public Overrides Property CssPostfix As String

Property Value

TypeDescription
String

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

|

Remarks

Use the CssPostfix property together with the ASPxFileManager.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 ASPxFileManager.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, required for parsing reasons.

Using postfixes solves the task of differentiating class names which define the same appearance settings of controls in different ways, in a web browser. 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 the correct styles, since all CSS classes are named identically within different CSS files.

Note

When you set the CssPostfix property, you disable not only the default CSS styles, but the default sprites, as well. The ASPxFileManager 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.

Concept

Example

Web Forms (in markup):

aspx
<dx:ASPxFileManager ID="fileManager" runat="server" CssPostfix="test_css" ...>
    ...
</dx:ASPxFileManager>

Web Forms (in code):

csharp
ASPxFileManager fm = new ASPxFileManager();
...
fm.CssPostfix="test_css";

MVC:

csharp
@Html.DevExpress().FileManager( settings => {
    settings.Name = "fileManager";
    settings.CssPostfix="test_css";
    ...
}).BindToFolder(Model).GetHtml()

See Also

File Manager

ASPxFileManager Class

ASPxFileManager Members

DevExpress.Web Namespace