Hi,
I am using client script to close my RadWindow after postback, as follows:
Now within Submit_Click I update the literal as follows:
This works fine, but the DestroyOnClose attribute of the window seems to be ignored as when I next launch the window, the contents are still there.
How can I destroy the window using the client-side close?
Thanks.
I am using client script to close my RadWindow after postback, as follows:
<
telerik:RadWindowManager
ID
=
"rwmWindow"
Width
=
"500px"
Height
=
"375px"
runat
=
"server"
DestroyOnClose
=
"true"
Modal
=
"true"
VisibleOnPageLoad
=
"false"
Title
=
"New Rad Window"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"rwWindow"
runat
=
"server"
ReloadOnShow
=
"true"
ShowContentDuringLoad
=
"false"
DestroyOnClose
=
"true"
Behaviors
=
"Close,Resize,Move"
OpenerElementID='<%# Parent.FindControl("btnMyLaunchButton").ClientID %>'>
<
ContentTemplate
>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
function GetRadWindow() {
var oWindow = null;
if (window.radWindow)
oWindow = window.RadWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow; //IE (and Moz as well)
return oWindow;
}
function Close() {
GetRadWindow().Close();
}
</
script
>
<
div
class
=
"window"
>
<
p
>This is the new rad window</
p
>
<
asp:literal
ID
=
"litClose"
runat
=
"server"
Visible
=
"false"
></
asp:literal
>
<
asp:Button
ID
=
"btnSubmit"
runat
=
"server"
Text
=
"Submit"
OnClick
=
"Submit_Click"
/>
</
div
>
</
ContentTemplate
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
Now within Submit_Click I update the literal as follows:
litClose.Text =
"<script type='text/javascript'>Close()</" + "script>";
This works fine, but the DestroyOnClose attribute of the window seems to be ignored as when I next launch the window, the contents are still there.
How can I destroy the window using the client-side close?
Thanks.