View Full Version : [CLOSED] Problem on success/failure return from a directMethod

Sep 30, 2013, 11:26 AM

I have a directMethod that I used to create an Excel file that I return from my method throught a Response object like that :

Response.AddHeader("content-disposition", "attachment; filename=" + xlsFileName)
Response.ContentType = "application/xls"
Response.WriteFile(Server.MapPath("~/xlsFiles/") + xlsFileName) 'return document

As computation take some time in code behind, I have decided to show a mask :

var callExcelComputation = function () {

maskOnLoad("Calcul en cours...", 'wndToMask');

App.direct.callExcelComputation ( {sucess: hideMask, failure: hideMask, isUpload: true });


var hideMask = function () {

It works well to put the mask, of course, but the sucess/failure function is never called, so I'm stuck with the mask on the screen :(

I think it can be related to the isUpload: true, that did not return corectly the sucess/failure thing, but found no way, until now, to make the things worked.

Sep 30, 2013, 12:34 PM
Hi @feanor91,

So, you download a file via AJAX. Unfortunately, there is a limitation - it doesn't fire success/failure events.

Generally speaking, there is no way to overcome it. Though, there is some trick that can be helpful and good enough in some scenarios.

Or, certainly, you can use, for example, Flash for downloading.

Sep 30, 2013, 1:04 PM
That was what I thought...

I will look at your example, thanks.