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

[Solved] Failure of download links after 'Ajaxifying' RadGrid

0 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Boris
Top achievements
Rank 1
Boris asked on 13 May 2013, 12:45 PM
I have a RadGrid with a GridButtonColumn that I use to download files from a binary field in my database.  This project has been going on for months and this has been working perfectly.  In the ItemDataBound event I set up the button if the binary field is not null. Nothing I've done lately has been directly related to it.

However now I've implemented RadWindow popups based on your examples and this required me to change the RadAjaxManager.

Now that the grid is 'Ajaxified', I've found that the download links have suddenly stopped working.  I've traced through the server side code in both the current and older versions and there has been no difference in execution of the code.  However once it gets to the end, it looks like the browser is just hanging with that circular 'loading' icon at the bottom left hand corner.

If I cut out both Ajax Settings from the manager, the download links function normally again.

Suggestions?

The manager declaration is as follows:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">

        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />  
                    <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>

        </AjaxSettings>
    </telerik:RadAjaxManager>

OK.  I think I've solved my problem.  I found this: http://www.telerik.com/community/forums/aspnet-ajax/grid/disabling-ajax-on-gridbuttoncolumn.aspx which was enough to get me started.

I changed my GridButtonColumn to a template with a RadButton.  Then I added   <ClientEvents OnRequestStart="mngRequestStarted" /> to my RadAjaxManager.

The only thing I couldn't get to work was that JavaScript RegExp (and I rarely use Regex) so my function wound up like this.  Seems to work.  Anyone see any problems doing it this way?

function mngRequestStarted(ajaxManager, eventArgs) {        
       if (eventArgs.EventTarget.indexOf("DownloadButton") > 0) {
            eventArgs.EnableAjax = false;
      }  
}

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Boris
Top achievements
Rank 1
Share this question
or