Re enable Ajax after disabling it on client side

3 posts, 1 answers
  1. Alexandre BARBIER
    Alexandre BARBIER avatar
    14 posts
    Member since:
    May 2009

    Posted 31 Jan 2011 Link to this post

    I'm using a RadGrid within a RajAjaxManager.
    On a specific LinkButton, I need to export the content of the grid to CSV.
    So I need to disable Ajax to allow export works. I'm doing this :



    script type="text/javascript">



    function mngRequestStartedEAE(ajaxManager, eventArgs) {



    if (eventArgs.EventTarget.indexOf("exportCsv") != -1) {


    eventArgs.EnableAjax =










    telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="mngRequestStartedEAE" >

            <telerik:AjaxSetting AjaxControlID="content">
                    <telerik:AjaxUpdatedControl ControlID="content" LoadingPanelID="RadAjaxLoadingPanel1" />
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="10"
        BackColor="#ffffff" CssClass="ajax_loader">
    <asp:Panel ID="content" runat="server" CssClass="MaxW">
    <!-- some other controls -->
    <asp:LinkButton ID="exportCsv" runat="server" OnClick="exportCsv_Click" Text="Exporter"></asp:LinkButton>
    <!-- grid declaration ... -->

    All of this works fine ! BUT :
    All other next requests doesn't works, because no more ajax is running :( So all actions like autopostback on controls within content panel are not invoked...

    What am I doing wrong ?

    Thanks for help !
  2. Answer
    Vasil avatar
    1642 posts

    Posted 03 Feb 2011 Link to this post

    Hi Alexandre,

    When the Ajax is enabled on the server it should be enabled by default after every postback even if you disable it on the client. This happens because the enabled setting is not persisted when changed client side and the next time the page loads it will be enabled again. It can see in this online demo that ajax requests are working after exporting the grid.

    Additionally you can try to place the LinkButton outside the 'content'  Panel which is ajaxified. This way the button will make regular postback, and you will not have to disable the ajax.
    You can also check this help articles:

    If you are still having such problem please share with us the whole aspx page that you use and its code behind.

    All the best,
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Alexandre BARBIER
    Alexandre BARBIER avatar
    14 posts
    Member since:
    May 2009

    Posted 07 Feb 2011 Link to this post


    I've finally found the issue, and you're right it is not a Grid export issue with ajax.
    It's just I used it into a control hosted into a SharePoint 2007 webpart page, and I've forgot the put the special trick that enabled ajax at every request. This trick modify the submit  JS function (from sharepoint) at page init event ...

    SO It's working fine....

    Thanks for reply

Back to Top