// Determine which item was clicked
if
(eventArgs.get_item().get_text() ==
"Lock and Submit"
) {
// Open the dialog
var
objWindow = $find(
"<%=rwLockAndSubmitPlan.ClientID%>"
);
objWindow.set_title(eventArgs.get_item().get_text());
objWindow.set_iconUrl(
"\Images/lock.png"
);
objWindow.setUrl(
"\Dialogs/LockAndSubmitPlan.aspx?mode=lockandsubmit"
);
objWindow.show();
}
else
if
(eventArgs.get_item().get_text() ==
"Provide Explanations"
) {
// Open the dialog
var
objWindow = $find(
"<%=rwLockAndSubmitPlan.ClientID%>"
);
objWindow.set_title(eventArgs.get_item().get_text());
objWindow.set_iconUrl(
"\Images/notepad.gif"
);
objWindow.setUrl(
"\Dialogs/LockAndSubmitPlan.aspx?mode=provideexplanations"
);
objWindow.show();
}
The issue is that while the window's title is, in fact, changed based on the button that was clicked, the window's icon is not. The first time I open the dialog, the window's icon is set, but that icon remains the window icon from that point on, not matter which button is clicked.
My RadWindowManager is defined as follows:
<
telerik:RadWindowManager
runat
=
"server"
ID
=
"rwmRadWindowManager"
VisibleStatusbar
=
"false"
ReloadOnShow
=
"true"
>
<
Windows
>
<
telerik:RadWindow
runat
=
"server"
ID
=
"rwLockAndSubmitPlan"
Modal
=
"true"
ReloadOnShow
=
"true"
VisibleTitlebar
=
"true"
Behaviors
=
"Close"
OnClientPageLoad
=
"OnClientPageLoad_SpendingPlan"
OnClientClose
=
"OnClientClose_Spending_Plan"
Width
=
"550"
Height
=
"450"
/>
</
Windows
>
</
telerik:RadWindowManager
>
And, the OnClientPageLoad_SpendingPlan function is defined as follows:
function
OnClientPageLoad_SpendingPlan(objWindow, objArguments) {
objWindow.set_status(
""
);
}
Perhaps this is a quick fix, so a prompt response would be much appreciated! Thank you!
11 Answers, 1 is accepted

Try setting the iconUrl as follows.
Javascript:
objWindow.set_iconUrl(
"../Images/lock.png
"
);
Thanks,
Shinu.

Your question is a general question about resolving relative path and you will face teh very same problem if you use standard HTML and no RadControls at all.
What I suggest is to call teh server method ResolveUrl e.g as shown below:
// Determine which item was clicked
if
(eventArgs.get_item().get_text() ==
"Lock and Submit"
) {
// Open the dialog
var
objWindow = $find(
"<%=rwLockAndSubmitPlan.ClientID%>"
);
objWindow.set_title(eventArgs.get_item().get_text());
objWindow.set_iconUrl(
"\Images/lock.png"
);
objWindow.setUrl(
"\Dialogs/LockAndSubmitPlan.aspx?mode=lockandsubmit"
);
objWindow.show();
}
else
if
(eventArgs.get_item().get_text() ==
"Provide Explanations"
) {
// Open the dialog
var
objWindow = $find(
"<%=rwLockAndSubmitPlan.ClientID%>"
);
objWindow.set_title(eventArgs.get_item().get_text());
var
resolvedUrl =
'<%= ResolveUrl("~/Images/notepad.gif")%>'
;
objWindow.set_iconUrl(resolvedUrl);
objWindow.setUrl(
"\Dialogs/LockAndSubmitPlan.aspx?mode=provideexplanations"
);
objWindow.show();
}
Svetlina
the Telerik team

Any other thoughts? Thanks!
Did you try my suggestion? Or probably I did not correctly understand your setup and requirement? The ResolveUrl method should evaluate the root by the fact that the tilde is used this should work as you describe your requirement. Please, test my suggestion and in case the issue persists, provide detailed reproduction instructions and we will do our best to help.
Greetings,Svetlina
the Telerik team

As noted in my previous post, I did try your solution and it did not work. Also, I've posted my code to my initial post, so please refer to that for an example. Please let me know how else I might be able to resolve this problem.
As far as I understand, you say that the icon url path you provide is correct - am I right? If so, you assume that the problem is that the RadWindow doe snot set the icon. there was such a problem in previous versions but it is fixed now - do you by any chance use an old version of RadControls?
I tested setting dynamically new icon url which a valid one and it works correctly on my side. You can test it with the following code:The code above keeps your logic - how you define and open the RadWindow, only some custom logic you have used which is not related to RadWindow and the urls are different (but you say that yours are valid and thus it does not matter).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
var flag = true;
function openRadWindow2() {
var oWnd = $find("<%=rwLockAndSubmitPlan.ClientID%>");
var originalUrl = flag ? "http://www.google.com" : "http://codechanger.com"
oWnd.set_iconUrl(originalUrl + "/favicon.ico");
oWnd.show();
flag = !flag;
}
function OnClientPageLoad_SpendingPlan(objWindow, objArguments) {
objWindow.set_status("");
}
</
script
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
asp:Button
ID
=
"Button2"
runat
=
"server"
OnClientClick
=
"openRadWindow2();return false;"
Text
=
"Open Window of other page"
/>
<
telerik:RadWindowManager
runat
=
"server"
ID
=
"rwmRadWindowManager"
VisibleStatusbar
=
"false"
ReloadOnShow
=
"true"
>
<
Windows
>
<
telerik:RadWindow
runat
=
"server"
ID
=
"rwLockAndSubmitPlan"
Modal
=
"true"
ReloadOnShow
=
"true"
VisibleTitlebar
=
"true"
Behaviors
=
"Close"
OnClientPageLoad
=
"OnClientPageLoad_SpendingPlan"
Width
=
"550"
Height
=
"450"
/>
</
Windows
>
</
telerik:RadWindowManager
>
</
form
>
</
body
>
</
html
>
Please, test the code above with your version and let us know whether it works. In case it does, please, make sure that your urls are correct and also that your custom code (condition met to change the icon, etc) is working as you expect.
Kind regards,
Svetlina
the Telerik team

Actually, there is no need to use a second button - the global variable called flag in my code toggles the two different logics. However, in order to follow your instructions I reworked the demo with two buttons as follows:
<%@ Page Language="C#" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Src="ProfileToolTip.ascx" TagName="ProfileToolTip" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function openRadWindow2(iconUrl) {
var oWnd = $find("<%=rwLockAndSubmitPlan.ClientID%>");
oWnd.set_iconUrl(iconUrl);
oWnd.show();
}
function OnClientPageLoad_SpendingPlan(objWindow, objArguments) {
objWindow.set_status("");
}
</
script
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
asp:Button
ID
=
"Button2"
runat
=
"server"
OnClientClick
=
"openRadWindow2('http://www.google.com/favicon.ico');return false;"
Text
=
"Open Window of other page 1"
/>
<
asp:Button
ID
=
"Button1"
runat
=
"server"
OnClientClick
=
"openRadWindow2('http://codechanger.com/favicon.ico');return false;"
Text
=
"Open Window of other page 2"
/>
<
telerik:RadWindowManager
runat
=
"server"
ID
=
"rwmRadWindowManager"
VisibleStatusbar
=
"false"
ReloadOnShow
=
"true"
>
<
Windows
>
<
telerik:RadWindow
runat
=
"server"
ID
=
"rwLockAndSubmitPlan"
Modal
=
"true"
ReloadOnShow
=
"true"
VisibleTitlebar
=
"true"
Behaviors
=
"Close"
OnClientPageLoad
=
"OnClientPageLoad_SpendingPlan"
Width
=
"550"
Height
=
"450"
/>
</
Windows
>
</
telerik:RadWindowManager
>
</
form
>
</
body
>
</
html
>
As you see, in the code above, the icon is correctly set - once to google icon and the next time - to the icon of the code converter. Please, test the code and let me know how to reproduce the issue.
All the best,
Svetlina
the Telerik team

Thanks again.
Hi Ryan,
The only possible issue is the positioning of the icon when a large icon is used under some browsers (IE and Chrome), but that is a browser limitation and is not related to the Telerik controls.
Here is a video from my experiment and as you can see it seems to be working fine: http://screencast.com/t/HO9NON8w6up.
If you keep experiencing difficulties please open a support ticket and send us a sample project that displays your issue.
All the best,
Marin
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.