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

Response.BinaryWrite in RadAjaxPanel

7 Answers 504 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
rmoynihan
Top achievements
Rank 1
rmoynihan asked on 10 Aug 2009, 12:53 PM
Hi,

I am creating a pdf programatically and then opening it in the browser.
I am doing this using

 response.BinaryWrite(pdfBytes);
 response.Flush();
 response.End();

It works fine when its not in a RadAjaxPanel but when it is inside the panel the document will not open.

Is there anyway to get it to work inside a RadAjaxPanel?

Thanks,

Ronan

7 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 10 Aug 2009, 01:03 PM
Hello Ronan,

I recommend you either register your "export button" as a postback trigger or cancel AJAX on RequestStarted client-side event:
Exclude controls from ajaxifying
Export from ajaxified grid

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
rmoynihan
Top achievements
Rank 1
answered on 10 Aug 2009, 01:28 PM
Cool. Thank you.

I went with the scriptmanager option and its fine now.
Quick Response.

Thanks,

Ronan
0
HananJ
Top achievements
Rank 1
answered on 28 Nov 2010, 09:30 AM
I have the same problem with the Treeview, I am trying to let the end user to download a file through right click on Menu item, but the Browser didn't show the save dialog, here is the HTML CODE:
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server"  Width="100%"
        LoadingPanelID="AjaxLoadingPanel2" OnRequestStart="onRequestStart">
  <telerik:RadSplitter ID="RadSplitter1" runat="server" ResizeMode="Proportional" OnClientLoad="resizeSplitter" OnRequestStart="onRequestStart" >
            <telerik:RadPane ID="RadPane1" runat="server" Width="20%" Scrolling="Y" OnRequestStart="onRequestStart">
                <table width="100%" cellpadding="0" cellspacing="0">
                    <tr>
                        <td>
                            <div style="height: 500px;">
                                <uctr:LSTreeView ID="uctrTreeView" runat="server" ParentPageName="translation"></uctr:LSTreeView>
                            </div>
                        </td>
                    </tr>
                </table>
            </telerik:RadPane>

Can you please Help, because i tried to disable Ajax on startRequest but this didn't work for me..
0
Daniel
Telerik team
answered on 29 Nov 2010, 12:13 PM
Hello Hanan,

Try the following:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function onRequestStart(sender, args)
        {
            if (args.get_eventTarget().indexOf("MyExportButton") >= 0)
                args.set_enableAjax(false);
        }
    </script>
</telerik:RadCodeBlock>
<hr />
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" ClientEvents-OnRequestStart="onRequestStart">
    <telerik:RadTreeView ID="uctrTreeView" runat="server">
        <Nodes>
            <telerik:RadTreeNode>
                <NodeTemplate>
                    <asp:Button ID="MyExportButton" Text="Export" runat="server" />
                </NodeTemplate>
            </telerik:RadTreeNode>
        </Nodes>
    </telerik:RadTreeView>
</telerik:RadAjaxPanel>

I hope this helps.

Best regards,
Daniel
the Telerik team
Browse the vast support resources we have to jumpstart 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.
0
Apoorva Srivastava
Top achievements
Rank 1
answered on 19 Aug 2011, 09:17 PM
I have a similar problem. I want Ajax Panel loading up while users are waiting to download the file. Is there a different workaround where ajax dont need to be disabled ?
0
Maria Ilieva
Telerik team
answered on 24 Aug 2011, 03:30 PM
Hello Apoorva,

Unfortunately it is not possible to export from radGrid without disabling the Ajax.
Instead of RadAjaxLoadingPanel I recommend you use RadProgressArea. For more information please examine the following links:
Using RadProgressArea
Custom Progress Monitoring

I hope this helps.

Greetings,
Maria Ilieva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Maria Ilieva
Telerik team
answered on 24 Aug 2011, 03:30 PM
Hello Apoorva,

Unfortunately it is not possible to export from radGrid without disabling the Ajax.
Instead of RadAjaxLoadingPanel I recommend you use RadProgressArea. For more information please examine the following links:
Using RadProgressArea
Custom Progress Monitoring

I hope this helps.

Greetings,
Maria Ilieva
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Ajax
Asked by
rmoynihan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
rmoynihan
Top achievements
Rank 1
HananJ
Top achievements
Rank 1
Apoorva Srivastava
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or