Hi,
My application opens modal dialogs on the client using RadWindowManager. I want to be able to open the dialog with a border or without. I've attached a boiled down example. The main page, Test.aspx, has two buttons for opening either one entirely client side. When you launch Test.aspx, then click "Has Border", you get a modal dialog (containing Test2.aspx) with a Black skin border. If instead, after launching Test.aspx, you click "No Border", you get a modal dialog without a border. Good.
Now here's the issue: Launch Test.aspx, and open a "No Border" dialog, then close it. Now click "Has Border", but you still get a "No Border" dialog. Basically whatever you click the first time, is what you get on all subsequent clicks. The script in Test.aspx is attempting to change the cssClass on the fly, which doesn't seem to work. The goal is to be able to open the page, open and close dialogs with the desired border or not, without having to refresh the page.
What am I not doing? Or is something not working right?
Dave
Test.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Test" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"head1"
runat
=
"server"
>
<
title
></
title
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function onOpenHasBorder(sender, args) {
args.set_cancel(true);
var mgr = GetRadWindowManager();
mgr.set_cssClass('');
var dlg = mgr.open('Test2.aspx', null);
dlg.set_cssClass('');
}
function onOpenNoBorder(sender, args) {
args.set_cancel(true);
var mgr = GetRadWindowManager();
mgr.set_cssClass('noBorder');
var dlg = mgr.open('Test2.aspx', null);
dlg.set_cssClass('noBorder');
}
</
script
>
</
telerik:RadCodeBlock
>
<
style
type
=
"text/css"
>
.noBorder .rwCorner .rwTopLeft,
.noBorder .rwTitlebar,
.noBorder .rwCorner .rwTopRight,
.noBorder .rwIcon,
.noBorder table .rwTopLeft,
.noBorder table .rwTopRight,
.noBorder table .rwFooterLeft,
.noBorder table .rwFooterRight,
.noBorder table .rwFooterCenter,
.noBorder table .rwBodyLeft,
.noBorder table .rwBodyRight,
.noBorder table .rwTitlebar,
.noBorder table .rwTopResize,
.noBorder table .rwStatusbar,
.noBorder table .rwStatusbar .rwLoading
{
display: none !important;
background-image: none !important;
}
</
style
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
EnablePageMethods
=
"true"
runat
=
"server"
/>
<
br
/>
<
br
/>
<
telerik:RadButton
ID
=
"btnHasBorder"
runat
=
"server"
Text
=
"Has Border"
OnClientClicking
=
"onOpenHasBorder"
/>
<
br
/>
<
br
/>
<
telerik:RadButton
ID
=
"btnNoBorder"
runat
=
"server"
Text
=
"No Border"
OnClientClicking
=
"onOpenNoBorder"
/>
<
telerik:RadWindowManager
ID
=
"modalWindowMgr"
runat
=
"server"
EnableShadow
=
"false"
Behaviors
=
"Close, Move"
DestroyOnClose
=
"true"
VisibleOnPageLoad
=
"false"
Skin
=
"Black"
AutoSize
=
"false"
Width
=
"800px"
Height
=
"580px"
ReloadOnShow
=
"false"
ShowContentDuringLoad
=
"false"
Modal
=
"true"
EnableViewState
=
"false"
VisibleStatusbar
=
"false"
Style
=
"z-index:9000"
/>
</
form
>
</
body
>
</
html
>
Test2.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test2.aspx.cs" Inherits="Test2" %>
<%@ Register TagPrefix="STL" TagName="cssConfirmDialog" src="~/css/dialogConfirm.ascx" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
meta
charset
=
"utf-8"
/>
<
title
></
title
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function onCloseClicking(sender, args) {
args.set_cancel(true);
window.close();
}
</
script
>
</
telerik:RadCodeBlock
>
<
style
type
=
"text/css"
>
html,body,form
{
height:100%;
margin:0;
padding:0;
}
</
style
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
EnablePageMethods
=
"true"
runat
=
"server"
/>
<
table
style
=
"height:100%; width:100%"
>
<
tr
>
<
td
style
=
"vertical-align:middle; text-align: center;"
>
<
div
>
<
telerik:RadButton
ID
=
"btnOK"
runat
=
"server"
Text
=
"Close Window"
AutoPostBack
=
"false"
OnClientClicking
=
"onCloseClicking"
/>
</
div
>
</
td
>
</
tr
>
</
table
>
</
form
>
</
body
>
</
html
>