Skip to main content
A newer version of this page is available.
Tab

ASPxWebControl.SetIECompatibilityMode(Int32) Method

Switches all DevExpress controls on a page to use the specified IE version.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v20.2.dll

NuGet Package: DevExpress.Web

Declaration

public static void SetIECompatibilityMode(
    int IEVersion
)

Parameters

Name Type Description
IEVersion Int32

An integer value that specifies the Internet Explorer browser version.

Remarks

A call to the SetIECompatibilityMode method changes the render manner of all DevExpress controls on a page, so that they behave correctly under the specified IE version.

Note that the SetIECompatibilityMode method does not allow setting the IE version/mode for our controls to one that is higher than the one specified in the User-Agent parameter. This means that calling ASPxWebControl.SetIECompatibilityMode(9) does nothing if a request has been sent from IE8. To elevate the IE version, use the ASPxWebControl.SetIECompatibilityModeEdge method. It allows you to force all DevExpress ASP.NET controls on the specified page to use the latest available IE version.

This method is useful when it is necessary to switch all DevExpress controls on the specified page to use the specified IE version at runtime. To accomplish this task declaratively, consider using the IE Compatibility Version configuration option.

Refer to the KA18646 Knowledge Base article to learn more.

Example for ASP.NET Web Forms

Code behind:

protected void Page_PreInit(object sender, EventArgs e) {
    DevExpress.Web.ASPxWebControl.SetIECompatibilityMode(8);
}

Example for ASP.NET MVC

Global.asax code:

protected void Application_AcquireRequestState(Object sender, EventArgs e) {
    DevExpress.Web.ASPxWebControl.SetIECompatibilityMode(8);
}
See Also