Here is a JavaScript function I've created:
function returnToParent() {
var oArg = new Object();
var oWnd = GetRadWindow();
oArg.ReturnValue = "Submit";
oWnd.close(oArg);
}
This is how I call the function on the client side:
<button title="Submit" runat="server" id="close" onclick="returnToParent(); return false;">
OK</button>
I'm trying to trigger this function on a server-side button click. To do so, I added a new button:
<asp:Button runat="server" ID="rtxtSubmitChange" OnClick="rtxtSubmitChange_Click" Text="Submit" />
And in the Button Click Event:
protected void rtxtSubmitChange_Click(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(GetType(),
"MyKey",
"returnToParent();",
false);
}
However, it seems that my code isn't working as expected. What could be wrong?