RadAjaxLoadingPanel causes error when exporting a txt file

2 posts, 0 answers
  1. sf
    sf avatar
    103 posts
    Member since:
    Apr 2009

    Posted 25 Jan 2011 Link to this post

    in my button click event i have:

    StringBuilder strTXTFileBuilder = new StringBuilder();
    Response.Clear();
    Response.AddHeader("content-disposition", "attachment;filename="ExportResult.txt");
    Response.Charset = "";
    strTXTFileBuilder.Append ("FirstItem:")...... // code to populate the stringbuilder
    Response.ContentType = "application/vnd.text";
    StringWriter stringWrite = new StringWriter();
    HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
    Response.Write(strTXTFileBuilder.ToString());
    Response.End();

    it works without RadAjaxLoadingPanel. Once I put onto the page a RadAjaxLoadingPanel, when i click on the button again i get error:
    Line: 6
    Error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
    Details: Error parsing near '


    any idea what am i doing wrong? please help
    thanks in advance
  2. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 27 Jan 2011 Link to this post

    Hello,

    It is not possible to transfer a file in asynchronous request - this is why you get an error. As we know RadAjaxLoadingPanel works with ajax requests only.
    In other words, this control is not suitable for your scenario.

    Regards,
    Daniel
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top