Solved
Not sure why I'm having so much trouble.
I have radToolbar, which I've follow the steps to create my own custom button that calls the radwindow of my choice. This window loads up a dialog window with a textbox and an OK, cancel button.
On "Ok" I want to perform an operation and then close the dialog window and reload the parent.
On cancel I just want to close the window.
I can get the window to show, but that's it. I can't get the window to close, I think the parent is refreshing just haven't been able to confirm yet.
I can't figure out how to
a) send the dialog window some variables, like userid
b) get the dialog to run code-behind then close
c) refresh parent window
On my dialog page I have this script..
and then the buttons:
Not sure why I'm having so much trouble.
I have radToolbar, which I've follow the steps to create my own custom button that calls the radwindow of my choice. This window loads up a dialog window with a textbox and an OK, cancel button.
On "Ok" I want to perform an operation and then close the dialog window and reload the parent.
On cancel I just want to close the window.
I can get the window to show, but that's it. I can't get the window to close, I think the parent is refreshing just haven't been able to confirm yet.
I can't figure out how to
a) send the dialog window some variables, like userid
b) get the dialog to run code-behind then close
c) refresh parent window
On my dialog page I have this script..
<script type="text/javascript" language="javascript"> |
function GetRadWindow() |
{ |
var oWindow = null; |
if (window.radWindow) |
oWindow = window.radWindow; |
else if (window.frameElement.radWindow) |
oWindow = window.frameElement.radWindow; |
return oWindow; |
} |
function cancelWindow() |
{ |
var oWindow = GetRadWindow(); |
oWindow.argument = null; |
oWindow.close(); |
} |
function closeClientCallBack() |
{ |
var currentWindow = GetRadWindow(); |
var Input = document.getElementById("ddlDocument"); |
currentWindow.argument = null; |
currentWindow.close(Input.value); |
RefreshParentPage(); |
} |
function clientClose() |
{ |
var currentWindow = GetRadWindow(); |
var Input = document.getElementById("ddlDocument"); |
currentWindow.argument = Input.innerText; |
currentWindow.close(); |
RefreshParentPage(); |
} |
function RefreshParentPage() |
{ |
GetRadWindow().BrowserWindow.location.href = GetRadWindow().BrowserWindow.location.href; |
} |
</script> |
and then the buttons:
<asp:Button |
ID="btnOpenDocument" |
runat="server" |
OnClientClick="closeClientCallBack();return false;" |
AlternateText="Open Document" |
Text="Open"> |
</asp:Button> |
<asp:Button |
ID="btnCancelOpenDocument" |
runat="server" |
OnClientClick="cancelWindow();return false;" |
Text="Cancel"> |
</asp:Button> |