I want to call the JavaScript function after the rad window close, but it does not work.
Following is my codes.
Please help me to solve the problem.
rad window page
Following is my codes.
Please help me to solve the problem.
Thank you very much.
http://ppt.cc/CVlG
parent page
function OpenRadWindow() { |
var oWnd = radopen('WebForm1.aspx', null); |
} |
function TestFunction() { |
alert("Test"); |
} |
<asp:ScriptManager ID="ScriptManager1" runat="server"> |
</asp:ScriptManager> |
<telerik:RadWindowManager ID="RadWindowManager1" runat="server"> |
</telerik:RadWindowManager> |
<br /> |
<asp:Button ID="Button1" runat="server" Text="Button" /> |
protected void Page_Load(object sender, EventArgs e) |
{ |
this.Button1.OnClientClick = "OpenRadWindow();return false;"; |
} |
rad window page
//This code is used to provide a reference to the radwindow "wrapper" |
function GetRadWindow() { |
var oWindow = null; |
if (window.radWindow) oWindow = window.radWindow; |
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; |
return oWindow; |
} |
function CallFunctionOnParentPage(fnName) { |
var oWindow = GetRadWindow(); |
if (oWindow.BrowserWindow[fnName] && |
typeof (oWindow.BrowserWindow[fnName]) == "function") { |
oWindow.BrowserWindow[fnName](oWindow); |
oWindow.close(); |
} |
} |
<asp:Label ID="InjectScript" runat="server"></asp:Label> |
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> |
//We do some server-side processing and we decide which function to call |
string fnName = "TestFunction()"; |
InjectScript.Text = "<script>CallFunctionOnParentPage('" + fnName + "')</" + "script>"; |