RadToolBar with Export File button

2 posts, 0 answers
  1. Nick S
    Nick S avatar
    10 posts
    Member since:
    Nov 2009

    Posted 24 Nov 2009 Link to this post

    Hi, I have a RadToolBar that contain Export Buttons so the user can download iCAL calendar on the page (using RadScheduler).  The RadToolBar is contained inside a RadGrad which ajaxified using RadAjaxManager.  Export button uses Response.Write to write an iCAL file back to the user.  When click on the Export button, I got the following error message:

    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 'BEGIN:VCALENDAR

    I tried to use RadScriptManager.GetCurrent(page).RegisterPostBackControl(btnExportButton) or RadScriptManager.GetCurrent(page).RegisterPostBackControl( RadToolBar)  both didn't work.

    I tried using the following example http://www.telerik.com/community/code-library/aspnet-ajax/general/export-radgrid-content-to-excel-word-csv-pdf-with-ajax-enabled.aspx
    but there is no specific example for the RadToolBar.  Can anybody help bring me to light???
    Thank you very much,
  2. Peter
    Peter avatar
    6637 posts

    Posted 26 Nov 2009 Link to this post

    Hi Nick,

    There is an iCalendar Export demo that you can use for reference:

    The important thing to note here is that you need a real postback for the export functionality. This is achieved by handling OnClientClick of the buttons ( OnClientClick="Export(this, event); ) like this:
    <script type="text/javascript">
                function Export(sender, e)
                    $find("<%= RadAjaxManager1.ClientID %>").__doPostBack(sender.name, "");

    Similarly, you should handle OnClientButtonClicking of RadToolBar.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top