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

RadAjaxLoadingPanel causes error when exporting a txt file

1 Answer 72 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
sf
Top achievements
Rank 1
sf asked on 25 Jan 2011, 08:55 AM

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

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 27 Jan 2011, 10:11 PM
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.
Tags
Ajax
Asked by
sf
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or