I'm trying to show an alert before a page redirect (after a form submission).
I tryed every possible scenario but it seems that the callback function (wich actually performs the redirect) is always executed before the window.
As a last option I tryed
where noPermanentLogin just:
Now when I first load the page the RadWindow should open each time and upon clicking "OK" button the alert should fire.
Instead the alert fires and the window is not created because of:
Uncaught TypeError: Cannot call method 'radalert' of undefined
It seems that the radwindow object has not yet been instantiated but nonetheless the callbackfunction executes the same.. this is quite mindblowing to me...
In the real scenario I tryed several versions, whose behaviour (in all situations) is that the callbackfunction gets executed BEFORE the window is showed. In those cases btw the window is showed.
So I tryed in code behind:
Then I tryed
And finally I tryed:
(in this last case redirectFunction calls the window redirect and is in an external JS in the page).
Why the callback function is executed even before showing the radalert?
Thanks in advance for your help
I tryed every possible scenario but it seems that the callback function (wich actually performs the redirect) is always executed before the window.
As a last option I tryed
<
asp:Panel
ID
=
"AjaxPanel"
runat
=
"server"
defaultbutton
=
"LoginConfirm"
>
<
telerik:RadScriptBlock
ID
=
"RadScriptBlock"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
activeAjaxRequest = false;
noPermanentLogin('sdf');
</
script
>
</
telerik:RadScriptBlock
>
function
noPermanentLogin(args) {
radalert(
'Radalert is called from the client!'
, 330, 180,
'Client RadAlert'
, alertCallBackFn(args),
''
);
}
function
alertCallBackFn(args) {
alert(args);
//window.location.href = args
}
Now when I first load the page the RadWindow should open each time and upon clicking "OK" button the alert should fire.
Instead the alert fires and the window is not created because of:
Uncaught TypeError: Cannot call method 'radalert' of undefined
It seems that the radwindow object has not yet been instantiated but nonetheless the callbackfunction executes the same.. this is quite mindblowing to me...
In the real scenario I tryed several versions, whose behaviour (in all situations) is that the callbackfunction gets executed BEFORE the window is showed. In those cases btw the window is showed.
So I tryed in code behind:
Me.AjaxManager.ResponseScripts.Add("noPermanentLogin('returnUrl')")
RadWindowManager.RadAlert("Testina", Nothing, Nothing, "Totolo", "window.location.href = '" & returnUrl & "'")
RadWindowManager.RadAlert("Testina", Nothing, Nothing, "Totolo", "redirectFunction('testurl')")
Why the callback function is executed even before showing the radalert?
Thanks in advance for your help