export to excel

M

Mike

On my page I'm using an updatepanel, updateProgress, and a ModalProgress,
everything works great But when I try to export my GridView to excel I'm
getting the following error message:

Sys.WebForms.PageRequestManagerParserErrorException: The message received
from the server could not be parsed. Common cause for this error are when
the response is modified by calls to Response.Write(), response filters,
HttpModules, or server trace is enable.

Details: Error parsing near '<div>
<table cells'.


How can I get my GridView to export to excel when I have it within the panel
and using the updateProgress and ModalProgress panel with it?
Here is my export code;

Response.Clear();
Response.AddHeader("content-disposition", "attachment;
filename=output.xls");
Response.Charset = "";
Response.ContentType = "application/ouput.xls";
System.IO.StringWriter stringWrite = new
System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new
HtmlTextWriter(stringWrite);
gOutput.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,516
Members
44,985
Latest member
rsts

Latest Threads

Top