Error when overring ContentType

2 posts, 0 answers
  1. Michael
    Michael avatar
    84 posts
    Member since:
    May 2008

    Posted 25 Jul 2009 Link to this post

    Hi

    I am generating a CSV file on the fly in my aspx page. RadCompression is giving me an error when processing is done and it is about to send a "application/octet-stream" content type to my page.

    Here's my code.

                    string strFileContent = sb.ToString(); // This is the CSV string generated 
     
                    // EXPORT 
                    string strFile = "export.csv"
                    string ContentType = "application/octet-stream"
     
                    Response.Clear(); 
                    Response.ContentType = ContentType; 
                    Response.AddHeader("Content-Disposition""attachment; filename=\"" + strFile + "\""); 
                    Response.Flush(); 
                    Response.Write(strFileContent); 
                    Response.End(); 

    I had to remove RadCompresstion from the web.config to get this working. Thanks.
  2. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 27 Jul 2009 Link to this post

    Hello Michael,

    Can you please specify the exact error you are getting? Are you by any chance have enabled the compression for full page postbacks? If this is the case you may disable it and see if this makes any difference. 

    All the best,
    Rosen
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top