Posted
on Feb 2, 2012
(permalink)
I just figured out how to do this.
I'm posting the code here, it might help someone.
I looked up the client script reference, and The RadWindow has a property called "argument" , and that was the key!
I can pass in the argument to the parent window using this.
//Client Window JavaScript:
function GetRadWindow() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow;
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return oWindow;
}
function SetArgumentValue(arg) {
var oWindow = GetRadWindow();
oWindow.argument = arg;
}
//Client Window C#
protected void OnMyEvent (object sender, EventArgs args)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "ReloadRepSessions", "SetArgumentValue(" + "'ThisIsMyArgument'" + ");", true);
}
//Parent Page Javascript
function OnClientBeforeClose(oWnd, args) {
var oWnd = $find("<%= RadWindow1.ClientID %>");
var arg = oWnd.argument;
...
//reload control on parent
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest(arg);
....
}
<telerik:RadWindow .... OnClientBeforeClose="OnClientBeforeClose"
//Parent Page c# code
protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
{
switch (e.Argument)
{
case "ThisIsMyArgument" ....
Hope this helps someone later.