Can you help me error with gzip !!!!

4 posts, 0 answers
  1. Vo
    Vo avatar
    6 posts
    Member since:
    Apr 2012

    Posted 04 Apr 2012 Link to this post

    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
  2. Rumen
    Admin
    Rumen avatar
    13804 posts

    Posted 09 Apr 2012 Link to this post

    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.
  3. Vo
    Vo avatar
    6 posts
    Member since:
    Apr 2012

    Posted 10 Apr 2012 Link to this post

    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.
  4. Rumen
    Admin
    Rumen avatar
    13804 posts

    Posted 11 Apr 2012 Link to this post

    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.
Back to Top