Skip to main content
Tab

ASPxWebControl.MakeResponseCompressed(Boolean) Method

Specifies that the response code (the HTML code of the web page) should be compressed on the server before sending it to the client, and accepts a parameter specifying whether to apply compression to IE6.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v24.2.dll

Declaration

public static void MakeResponseCompressed(
    bool applyToIE6
)

Parameters

Name Type Description
applyToIE6 Boolean

true to enable compression under IE6; otherwise, false.

Remarks

In contrast to using the Page HTML Compression Web.Config option, the MakeResponseCompressed method allows you to enable HTML compression for individual web pages.

This method overload allows you to control whether to enable page HTML compression for Internet Explorer 6.

Note that in version v2010 vol2, we decided to suppress our internal HTTP compression (controlled by the Page HTML Compression config option) for IE6. This is due to different unpredictable problems that occurred in IE6 with enabled compression.

In some application scenarios however, it may be required to have response compression enabled for all browsers including IE6.

For such scenarios, we provide a way to activate compression by using this MakeResponseCompressed overload, accepting a Boolean parameter. This parameter allows our internal response compression to be always switched on, without checking client browser versions. It is necessary to call this method in the Application_PreRequestHandlerExecute event (Global.asax).

void Application_PreRequestHandlerExecute(object sender, EventArgs e){
    DevExpress.Web.ASPxWebControl.MakeResponseCompressed(true);
}

Using this method makes all responses sent from the server (whether they were requested via callbacks or not) compressed.

See Also