Cannot download file from Ajaxified button

2 posts, 1 answers
  1. Vishnu
    Vishnu avatar
    21 posts
    Member since:
    Jun 2014

    Posted 17 Jul 2014 Link to this post


    There is an ASP button in the Content page of my web application and its ajaxified using the RadAjaxManagerProxy. In the server side click event of the button, I am trying to download a csv file.

    When the button is ajaxified, the csv file is not getting downloaded and I noticed that the void Application_Error(object sender, EventArgs e) in Global.asax is firing on putting a break point.  If I remove the ajax from the button, then the code works fine as expected.

    Here is a complete sample of my scenario.

  2. Answer
    Konstantin Dikov
    Konstantin Dikov avatar
    1750 posts

    Posted 22 Jul 2014 Link to this post

    Hello Vishnu,

    This is a standard limitation when AJAX is enabled, which prevents file downloading in such manner.

    In order to allow the download you will need to temporarily disable the AJAX. This could be easily achieved by handling the client-side OnRequestStart event of RadAjaxManager. Following is a very simple example demonstrating how to disable AJAX for a particular control:
    <telerik:RadCodeBlock runat="server">
        <script type="text/javascript">
            function requestStart(sender, args) {
                if (args.get_eventTarget().indexOf("Button1") >= 0) {
    <telerik:RadAjaxManager ID="ajaxManagerProxy" runat="server" ClientEvents-OnRequestStart="requestStart">

    In your particular scenario you could just remove the RadButton from the AJAX settings, but in more complex scenario, the above approach must be used.

    Hope this helps.

    Konstantin Dikov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top