Hi,
I am trying to get the sample "Postback And Close On Reload" running for my own dialog box but always getting java-script error for some objects not found.
What I basically try to do is combine the online sample "Using RadWindow URL to supply server arguments" and the help sample "Postback And Close On Reload". The first one works quite well but the second does not.
Here is what I did so far:
In the parent page I am open the dialog with a js-function like this:
Therefore I've added the following JScript on the dialog.aspx:
I am not really sure what are control names and what are types in the JScript code above. For example as I understood the RadWindow created is named "TrashConfirmWindow". Do I need to refer to the from the dialog by its name? Tried this as well (instead of ".RadWindow") but did not work neighter.
Does anybody have an idea what is going wrong here?
Thanks and cheers,
Marc
I am trying to get the sample "Postback And Close On Reload" running for my own dialog box but always getting java-script error for some objects not found.
What I basically try to do is combine the online sample "Using RadWindow URL to supply server arguments" and the help sample "Postback And Close On Reload". The first one works quite well but the second does not.
Here is what I did so far:
In the parent page I am open the dialog with a js-function like this:
<script type="text/javascript">The dialog contains two buttons - "Yes" and "No". Both of them are doing a server postback. "No" should just close the dialog while "Yes" sould to some server-side action, close the dialog and refresh the parent page.
function openRadWindow(VoterID, EventID)
{
var oWnd = radopen("DialogVoterDelete.aspx?voterid=" + VoterID + "&eventid=" + EventID, "TrashConfirmWindow" );
oWnd.Center();
}
</script>
Therefore I've added the following JScript on the dialog.aspx:
<script type="text/javascript">In the dialog.aspx I inserted a literal named "InjectScript" with the "passthrough" option set. On the server-side (C#) I've implemented the two methods below:
//This code is used to provide a reference to the radwindow "wrapper"
function GetRadWindow()
{
var oWindow = null;
if (window.RadWindow1) oWindow = window.RadWindow1; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.RadWindow1) oWindow = window.frameElement.RadWindow1;//IE (and Moz az well)
return oWindow;
}
function CloseOnReload()
{
GetRadWindow().close();
}
function RefreshParentPage()
{
GetRadWindow().BrowserWindow.location.reload();
}
</script>
private void CloseDialogOnRefresh()These two functions where called from the server-side Click-Handlers but none of them works. Both results in a JScript error for some Null-References within the dialog.aspx.
{
InjectScript.Text = "<script>CloseOnReload()</script>";
}
private void RefreshParentPage()
{
InjectScript.Text = "<script>RefreshParentPage()</script>";
}
I am not really sure what are control names and what are types in the JScript code above. For example as I understood the RadWindow created is named "TrashConfirmWindow". Do I need to refer to the from the dialog by its name? Tried this as well (instead of ".RadWindow") but did not work neighter.
Does anybody have an idea what is going wrong here?
Thanks and cheers,
Marc