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

RadToolBar with Export File button

1 Answer 129 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Nick S
Top achievements
Rank 1
Nick S asked on 24 Nov 2009, 09:33 PM
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
VER'.

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,
Nick

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 26 Nov 2009, 01:28 PM
Hi Nick,

There is an iCalendar Export demo that you can use for reference:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/export/defaultcs.aspx

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, "");
            }
        </script>

Similarly, you should handle OnClientButtonClicking of RadToolBar.


Best wishes,
Peter
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.
Tags
ToolBar
Asked by
Nick S
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or