ajaxmanager and export function

6 posts, 1 answers
  1. Morten
    Morten avatar
    267 posts
    Member since:
    Jul 2012

    Posted 18 Oct 2010 Link to this post

    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
  2. Answer
    Dimo
    Admin
    Dimo avatar
    8333 posts

    Posted 21 Oct 2010 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. T
    T avatar
    1 posts
    Member since:
    Jan 2012

    Posted 09 Jan 2012 Link to this post

    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.
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 10 Jan 2012 Link to this post

    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
  6. Tee
    Tee avatar
    1 posts
    Member since:
    Jul 2012

    Posted 16 Jul 2015 in reply to Maria Ilieva Link to this post

    Do you know if there is any work around for this? Thank you.
  7. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 20 Jul 2015 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017