export to excel

Discussion in 'ASP .Net' started by Mike, Mar 19, 2008.

  1. Mike

    Mike Guest

    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();
     
    Mike, Mar 19, 2008
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGF2aWQgVmFsbGU=?=

    Invalid export DLL or export format

    =?Utf-8?B?RGF2aWQgVmFsbGU=?=, Oct 29, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    3,626
    =?Utf-8?B?RGF2aWQgVmFsbGU=?=
    Oct 29, 2003
  2. =?Utf-8?B?U3JpZGhhcg==?=

    using Microsoft Excel image for Export to Excel button

    =?Utf-8?B?U3JpZGhhcg==?=, Dec 9, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    3,117
    =?Utf-8?B?U3JpZGhhcg==?=
    Dec 9, 2005
  3. =?Utf-8?B?SGVtYW50IFNpcGFoaW1hbGFuaQ==?=

    Export to Excel (Default File Type - Excel)

    =?Utf-8?B?SGVtYW50IFNpcGFoaW1hbGFuaQ==?=, Apr 24, 2006, in forum: ASP .Net
    Replies:
    15
    Views:
    17,539
    syed hassan
    May 21, 2009
  4. Grey
    Replies:
    4
    Views:
    2,000
    Mark Rae [MVP]
    Oct 17, 2007
  5. Maarten Porters
    Replies:
    1
    Views:
    432
    Florian Gilcher
    Jul 28, 2008
Loading...

Share This Page