Hello,
I have a radwindowmanager in a master page, with 2 radwindows defined, and an alert template, like so:
Now, from a client page I try to catch any error and show a message to the user via radalert by calling it from code-behind, like so:
What I'm trying to do is check if multiple radalerts are open, close them and show only one radalert with a generic message. I try to do this in the master page like this
The problem is that 'wManager.get_windows();' only contains the 2 RadWindows I have defined, and not the radalerts. Why is that? Is there some other way I can achieve what I want?
I have a radwindowmanager in a master page, with 2 radwindows defined, and an alert template, like so:
<
telerik:RadWindowManager
ID
=
"myId"
runat
=
"server"
ReloadOnShow
=
"true"
<br>
OnClientShow="Hideloading" DestroyOnClose="true"><
br
>
<
AlertTemplate
><
br
>
<
div
class
=
"rwDialogPopup radalert"
><
br
>
<
div
class
=
"rwDialogText"
><
br
>
<
div
class
=
"space"
><
br
>
</
div
><
br
>
<
b
>{1}</
b
><
br
>
<
br
/><
br
>
<
a
onclick
=
"$find('{0}').close();FocusLastFocusedControl();"
onkeypress
=
"return GetChar(event,'{0}');"
<br>
class="rwPopupButton" href="javascript:void(0);"><
span
class
=
"rwOuterSpan"
><
span
<br>
class="rwInnerSpan">##LOC[OK]##</
span
> </
span
></
a
><
br
>
<
div
class
=
"clear"
><
br
>
</
div
><
br
>
</
div
><
br
>
</
div
><
br
>
</
AlertTemplate
><
br
>
<
Windows
><
br
>
<
telerik:RadWindow
ID
=
"id1"
AutoSize
=
"true"
Modal
=
"true"
Title
=
"title1"
<br>
runat="server" KeepInScreenBounds="true" VisibleStatusbar="false"<
br
>
RegisterWithScriptManager="true" Behaviors="Close, Move, Resize" Height="450px"<
br
>
OnClientBeforeShow="ClientShow" AutoSizeBehaviors="Height"><
br
>
<
ContentTemplate
><
br
>
<%-- ... --%><
br
>
</
ContentTemplate
><
br
>
</
telerik:RadWindow
><
br
>
<
telerik:RadWindow
ID
=
"id2"
AutoSize
=
"true"
Modal
=
"true"
ReloadOnShow
=
"True"
<br>
KeepInScreenBounds="true" VisibleStatusbar="false"<
br
>
RegisterWithScriptManager="true" Behaviors="Move, Resize"<
br
>
DestroyOnClose="true" runat="server" OnClientClose="CloseAddNoteWindow" Title="title2"><
br
>
<
ContentTemplate
><
br
>
...<
br
>
</
ContentTemplate
><
br
>
</
telerik:RadWindow
><
br
>
</
Windows
><
br
>
</
telerik:RadWindowManager
>
Now, from a client page I try to catch any error and show a message to the user via radalert by calling it from code-behind, like so:
RadWindowManager1.RadAlert(ex.Message, 450, 210,
ex.Message,
string.Empty);
What I'm trying to do is check if multiple radalerts are open, close them and show only one radalert with a generic message. I try to do this in the master page like this
Sys.Application.add_load(loadHandle);
function loadHandle() {
var wManager = GetRadWindowManager();
var windows = wManager.get_windows();
var wCount = windows.length;
if (wCount > 3)
{
//close all pop-ups and display a generic message pop-up about multiple errors
wManager.closeAll();
radalert('Multiple errors', null, null, 'Multiple errors');
}
}
The problem is that 'wManager.get_windows();' only contains the 2 RadWindows I have defined, and not the radalerts. Why is that? Is there some other way I can achieve what I want?