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

Set Client Events On Request Start with Ajax Manager Proxy

4 Answers 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin
Top achievements
Rank 1
Justin asked on 17 Jul 2014, 05:32 PM
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


4 Answers, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 17 Jul 2014, 06:47 PM
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
0
Jayesh Goyani
Top achievements
Rank 2
answered on 17 Jul 2014, 06:52 PM
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
0
Justin
Top achievements
Rank 1
answered on 17 Jul 2014, 07:13 PM
Jayesh,

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

-Justin
0
Rahul
Top achievements
Rank 1
answered on 22 Dec 2015, 04:20 PM

Thanks Jayesh

The given link is really helpful :)

Tags
Grid
Asked by
Justin
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Justin
Top achievements
Rank 1
Rahul
Top achievements
Rank 1
Share this question
or