Ok I'm kinda new to the Telerik tools so hope this doesn't sound too strange...
I created a user control with the RadWindowManager and a jscript function to open the window as below:
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="RadWindowManager.ascx.vb" Inherits="Controls_RadWindowManager" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<telerik:RadWindowManager
runat="server"
RestrictionZoneID="offsetElement"
EnableShadow="true"
ShowOnTopWhenMaximized="false"
VisibleStatusbar="false"
Behaviors="Close, Move, Resize, Maximize"
Opacity="99"
Height="400"
Width="400" >
</telerik:RadWindowManager>
<script type="text/javascript">
function OpenRadWindow(url, title, width, height, modal, onBeforeCloseEvent, onCloseEvent) {
if (url == null) { url = "" }
if (title == null) { title = "" }
if (width == null) { width = 400 }
if (height == null) { height = 400 }
if (modal == null) { modal = true }
var wnd = window.radopen(url, null);
wnd.SetTitle(title);
wnd.setSize(width, height);
wnd.set_modal(modal);
if (onBeforeCloseEvent != null) {
wnd.add_beforeClose(onBeforeCloseEvent);
}
if (onCloseEvent != null) {
wnd.add_onClose(onCloseEvent);
}
return false;
}
</script>
The idea was to not have to declare it all over the place as we have many popups in our system and some require different variables than others.
Anyways Part 2:
In one of my pages I have a popup that requires some inputs and such and needs to refresh the main page when it closes.
<%@ Register Src="~/Controls/RadWindowManager.ascx" TagName="RadWindowManager" TagPrefix="uc3" %>
<uc3:RadWindowManager ID="RadWindowManager" runat="server" />
function OpenAddProduct() {
var url = <%= """" & ResolveUrl("~/Levels/Products.Aspx?Popup=1") & """" %>;
OpenRadWindow(url, "Manage Products", 765, 500, true, null, alert("This is supposed to be a close event..."));
}
Obviously what I am expecting is when the window is closed an alert to popup with that message, however what I am getting is that as soon as the window opens it is firing the OnClose event the same goes for the OnBeforeClose as well.
Am I just doing something wrong here declaring the window or is there more to it???