I have a web page and it has one textbox and button. User can enter specific url to textbox and clicking button opens a new telerik window. This popup window has cancel button and clicking that button close the window.
For example: When user navigates http://server1/testpage.aspx then user enters http://server1/newpopup.aspx then clicks open button and popup shows up then user clicks cancel button on the newpopup.aspx page window closes. When user types http://server2/newpopup.aspx popup shows up but clicking cancel button does not close the newpopup window and it gives access denied error message. This is not a cross browsing issue because I am trying to close popup window in the popup window control.
//Open popup
protected void xcBrowseDes_Click(object sender, EventArgs e)
{
string destinationURL = txtDESTURL.Text.ToLower().Trim().TrimEnd(new char[] { '/' });
ScriptManager.RegisterStartupScript(xcBrowseDes, typeof(string), "alertScript1", "Confirm('" + destinationURL+"');",true);
}
//javascript
function Confirm(par) {
var oWnd = radopen(par, "Browse");
var width = $(window).width();
if (width > 750)
width = 750;
oWnd.setSize(width - 15, $(window).height() - 15);
oWnd.center(true);
oWnd.set_modal(false);
}
//javascript closing popup window
function GetRadWindowClose() {
var oWindow = null;
if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
oWindow.close();
}
I also tried just window.close() javascript method or self.close() but both methods did not close the window.