-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
I want to show my toast when ajax calls return after completion. I tried to do it in Controller Action Method but it does not work
function GetOneDriveFileDownloadURL() {
$("body").addClass("loading");
$.ajax({
type: "GET",
url: "/Ajax/GetOneDriveFileDownloadURL",
contentType: "application/json; charset=utf-8",
dataType: "json",
error: function (xhr, status, error) {
}
}).done(function (data) {
var link = document.createElement('a');
link.href = data;
link.download = "Test.txt";
link.dispatchEvent(new MouseEvent('click'));
$("body").removeClass("loading");
});
}
> API Success Call
``
if (OneDriveApi.AccessToken.AccessToken != null)
{
if (fileOneDriveItem != null)
{
_notifyService.Success("This is a Success Toast",100000);
return new JsonResult(fileOneDriveItem.DownloadUrlAnnotation);
}
}
Metadata
Metadata
Assignees
Labels
No labels