I'm using a custom user control in my RadGrid to add new customer using the below markup.
In the user control I have a save button which saves the data to the database and once this is done I want it to close the (modal edit) window and navigate the browser (parent) window to the customer preview screen.
So in my code behind I've placed the following (I've used this code for RadWindows before and it works fine).
I have the below in the page (again, used this before with RadWindows and all is fine).
As I've said, I've used the above two pieces of code before with RadWindows and all is fine, they close and the browser window navigates to the new screen.
However with the Edit Form, the modal popup does close and then reopens and the browser does not navigate to the preview screen. When I tried removing the redirection in the JavaScript and only close the popup window the same happens, the window closes and then opens again.
Is there some other setting I need to set here?
Thanks.
Liam
<EditFormSettings EditFormType="WebUserControl" UserControlName="~/controls/customer/Details.ascx"> |
<PopUpSettings Width="600px" Height="400px" Modal="true" /> |
</EditFormSettings> |
In the user control I have a save button which saves the data to the database and once this is done I want it to close the (modal edit) window and navigate the browser (parent) window to the customer preview screen.
So in my code behind I've placed the following (I've used this code for RadWindows before and it works fine).
string script = "<script language='javascript' type='text/javascript'>CloseAndRedirect('" + VOPCustomerID.ToString() + "');</script>"; |
Page.ClientScript.RegisterStartupScript(this.GetType(), "Close", script); |
I have the below in the page (again, used this before with RadWindows and all is fine).
<script type="text/javascript"> |
function CloseAndRedirect(ss) |
{ |
//Redirect to new url |
GetRadWindow().BrowserWindow.location.href = '../Customer/Default.aspx?CustID=' + ss; |
//closes the window |
GetRadWindow().close(); |
} |
//Get reference to window |
function GetRadWindow() |
{ |
var oWindow = null; |
if (window.radWindow) |
oWindow = window.radWindow; |
else if (window.frameElement.radWindow) |
oWindow = window.frameElement.radWindow; |
return oWindow; |
} |
</script> |
As I've said, I've used the above two pieces of code before with RadWindows and all is fine, they close and the browser window navigates to the new screen.
However with the Edit Form, the modal popup does close and then reopens and the browser does not navigate to the preview screen. When I tried removing the redirection in the JavaScript and only close the popup window the same happens, the window closes and then opens again.
Is there some other setting I need to set here?
Thanks.
Liam