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

ajaxmanager and export function

5 Answers 74 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Morten
Top achievements
Rank 1
Iron
Iron
Veteran
Morten asked on 18 Oct 2010, 10:06 PM
I'd like to ajaxify a button (btnExportTasks) that uses Aspose.Cells to export some data. When set to the code below nothing happens.

What should my AjaxSettings look like?

<telerik:RadAjaxManager runat="server" ID="ram">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btnExportTasks">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="btnExportTasks" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

btnExportTasks code behind handler:
...
  workbook.Save(Me.Response, "StoreItemTasks.xls"ContentDisposition.Attachment, New XlsSaveOptions())
  Response.End()
End Sub

5 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 21 Oct 2010, 04:19 PM
Hello Morten,

Actually exporting and sending a file to the browser can be done only during a regular postback. If exporting is performed through an asynchronous request, the information can not be passed through the XMLHttpObject - that is why the communication between the browser and the server fails. You should not ajaxify the button at all.

All the best,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tee
Top achievements
Rank 1
answered on 09 Jan 2012, 06:27 PM
Does this rule still hold true with the latest version of Telerik? I am having trouble incorporating AJAX with my Export to Excel button. Please help. Thanks.
0
Maria Ilieva
Telerik team
answered on 10 Jan 2012, 11:09 AM
Hi,

Note that this is general MS Ajax framework limitation and it is not directly generated by our control. Exporting any data even with asp UpdatePanel is not possible. For the general export functionality it is needed to perform a regular postback instead of Ajax call. This is the current framework behaviour and as we are built on the top of MS Ajax the same is applicable for our Ajax controls.

All the best,
Maria Ilieva
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Tee
Top achievements
Rank 1
answered on 16 Jul 2015, 06:10 PM
Do you know if there is any work around for this? Thank you.
0
Maria Ilieva
Telerik team
answered on 20 Jul 2015, 03:34 PM
Hello Tee,

You can exclude the export buttons from ajaxifying as shown below:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/ajaxified-radgrid/what-you-should-have-in-mind/export-from-ajaxified-grid

I hope this helps.

Regards,
Maria Ilieva
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Ajax
Asked by
Morten
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Dimo
Telerik team
Tee
Top achievements
Rank 1
Maria Ilieva
Telerik team
Tee
Top achievements
Rank 1
Share this question
or