This is a migrated thread and some comments may be shown as answers.

Can you help me error with gzip !!!!

3 Answers 120 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Vo
Top achievements
Rank 1
Vo asked on 04 Apr 2012, 08:37 AM
I creat a project and using gzip in Global.asax :
 protected void Application_BeginRequest(object sender, EventArgs e)
    {
        HttpApplication app = (HttpApplication)sender;
        string acceptEncoding = app.Request.Headers["Accept-Encoding"];
        System.IO.Stream prevUncompressedStream = app.Response.Filter;

        if (acceptEncoding == null || acceptEncoding.Length == 0)
            return;

        acceptEncoding = acceptEncoding.ToLower();

        if (acceptEncoding.Contains("gzip"))
        {
            // gzip
            app.Response.Filter = new System.IO.Compression.GZipStream(prevUncompressedStream,
                System.IO.Compression.CompressionMode.Compress);
            app.Response.AppendHeader("Content-Encoding",
                "gzip");
        }
        else if (acceptEncoding.Contains("deflate"))
        {
            // defalte
            app.Response.Filter = new System.IO.Compression.DeflateStream(prevUncompressedStream,
                System.IO.Compression.CompressionMode.Compress);
            app.Response.AppendHeader("Content-Encoding",
                "deflate");
        }
    }
But I use control of Telerik then style error. It doen't display. Can I help me fix.Thanks all
Project address : <the link was removed because the project contains a registered Telerik.Web.UI.dll, which violates the license agreement - please remove the dll or the whole project from the shared location>
My email :vthoangtnt@gmail.com

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 09 Apr 2012, 08:28 AM
Hi,

I tested the provided project by replacing the Telerik controls with a simple Asp:Button control placed in an update panel:

<asp:UpdatePanel ID="Updatepanel1" runat="server">
    <ContentTemplate>
    <asp:Button ID="Button1" Text="text" runat="server" />
    </ContentTemplate>
</asp:UpdatePanel>


and I got the following JavaScript errors: Invalid Character ScriptResouces.axd and Error: 'Sys' is undefined. I also examined the page with Fiddler and Firebug and noticed that in the Response Headers the Content-Encoding is gzip,gzip. The correct value is gzip. You can see my test in the following video: http://screencast.com/t/nRuceqUtoGoK.

Your custom code in the Global.asax breaks the Ajaxification of the page. Since this is a general knowledge issue, which is not directly related to Telerik controls, my suggestion is to search in Google and ASP.NET AJAX forums for a solution for it.

Best regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Vo
Top achievements
Rank 1
answered on 10 Apr 2012, 08:57 AM
Thankyou.
I searched on google and forum Telerik but I don't fix error. javascrip and stylesheet still error. Can you help me fix it.
0
Rumen
Telerik team
answered on 11 Apr 2012, 09:51 AM
Hi,

Our suggestion is to enable the gzip compression in IIS instead of using the .NET framework to do that.

If you want to enable it using the framework than you should exclude the axd resources from the compression in your code.

Once again, please, note that this is a general knowledge question, which is not directly related to Telerik support.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Vo
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Vo
Top achievements
Rank 1
Share this question
or