Set Client Events On Request Start with Ajax Manager Proxy

5 posts, 1 answers
  1. Justin
    Justin avatar
    20 posts
    Member since:
    Jul 2011

    Posted 17 Jul 2014 Link to this post

    Hello,

    I am following one of your demos on how to export radGrid data to PDF. http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/exporting/pdf-export/defaultcs.aspx

    After following the demo I ran into an issue where nothing would happen after clicking the "downloadPDF" button. After some research I came to learn that this may be caused by an AJAX issue because the page needs to return stream rather than XttpRequest used for AJAX.

    The proposed solution (which is outlined in your demo) is to add a block of javascript code to the page like this:

    <script type="text/javascript">
        function requestStart(sender, args) {
            if (args.get_eventTarget().indexOf("btnDownloadPDF") > 0)
                args.set_enableAjax(false);
        }
    </script>


    The problem I am having is that I must somehow tie this function to the AjaxManager's ClientEvents-On-RequestStart attribute, but I am using an AjaxManagerProxy (since we already have an AjaxManager on the master page) and the AjaxMangerProxy does not seem to posses such a client side setting.

    Please advise on how I can set this value for ClientEvents-On-RequestStart for an AjaxManagerProxy?

    Thanks in advance,
    Justin


  2. Answer
    Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 17 Jul 2014 in reply to Justin Link to this post

    Hi,

    You can add this client side event using code behind.

    http://www.luminowebdesign.com/menu/about/tech-blog/making-ajaxrequest-calls-from-usercontrols-and-content-pages

    Let me know if any concern.

    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 17 Jul 2014 in reply to Jayesh Goyani Link to this post

    Hello,

    If you add "ClientEvents-On-RequestStart" on RadAjaxmanager then it also works for RadAjaxmanagerProxy.

    In short if you add Client event in radajaxmanager in master then it also works for your child/Content page.

    Thanks,
    Jayesh Goyani
  5. Justin
    Justin avatar
    20 posts
    Member since:
    Jul 2011

    Posted 17 Jul 2014 in reply to Jayesh Goyani Link to this post

    Jayesh,

    Thank you very much for your reply. That link was immensely helpful. My sincerest gratitude.

    -Justin
  6. Rahul
    Rahul avatar
    27 posts
    Member since:
    Jul 2015

    Posted 22 Dec 2015 Link to this post

    Thanks Jayesh

    The given link is really helpful :)

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017