Hi,
We have used GZIP compression technique for our web application but, we Could not compress the pages which has used infragistics controls as it throws “Object expected” error while GZIP accessing the java script file in ig_common folder.
When debugging the page in local machine the problem occurs but it is working fine in the virtual. I have attached the screenshot for your reference. Could you please suggest me how to overcome this issue?
Application type: Web
Coding: VB.Net
Framework Version: 4.0
Infragistics version: 11.1.20111.2064
Hello Sphinx,
Can you share the code you are using to compress the pages?
Hi Prabha,
The infragistics controls in our application refers the scripts from the application folder(~/ig_common/scripts) configured in the web.config file.
<infragistics.web styleSetPath="Default" javaScriptDirectory="~/ig_common/scripts" imageDirectory="~/ig_common/images"/>
We have used the below code in Global.asax.vb page in Application_Beginrequest event.
Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)
'Fires at the beginning of each request
Dim app As HttpApplication = DirectCast(sender, HttpApplication)
Dim acceptEncoding As String = app.Request.Headers("Accept-Encoding")
Dim prevUncompressedStream As Stream = app.Response.Filter
If (acceptEncoding.Length = 0) Then
Return
End If
acceptEncoding = acceptEncoding.ToLower()
If (acceptEncoding.Contains("gzip")) Then
app.Response.Filter =New GZipStream(prevUncompressedStream, CompressionMode.Compress)
app.Response.AppendHeader("Content-Encoding", "gzip")
ElseIf (acceptEncoding.Contains("deflate")) Then
app.Response.Filter New DeflateStream(prevUncompressedStream, CompressionMode.Compress)
app.Response.AppendHeader("Content-Encoding", "deflate")
End Sub