I am developing a site in asp.net & c#. I am not very familiar with javaScript but I'm using a little bit for some things. In order to create a pop up window I used the following javaScript code:
<script type="text/javascript" language="javascript">
function OpenCallUpdatePop(popUrl) {
CallUpdatePop = window.open(popUrl, 'callUpPop', 'toolbar=no, location=yes, scrollbars=yes, width=900, height=700')
setTimeout('CallUpdatePop.scroll(0,100)', 1000)
}
</script>
The parameter popUrl is populated by the following c# code:
string updateUrl = string.Format("UpdatePopUpPage.aspx");
ClientScript.RegisterStartupScript(this.GetType(), "myScript", "<script language=JavaScript>OpenCallUpdatePop('" + updateUrl + "');</script>");
I have a timer on the page set for a few seconds before Session timeout in order to redirect to the Logout page where FormsAuthentication.SignOut(); takes place. The Response.Redirect() to the LogOut Page doesn't work from the child window so I tried a javaScript function:
function closeThis() {
self.close()
}
Which was called from the following c# sharp code:
protected void timerLogOut_Tick(object sender, EventArgs e)
{
ClientScript.RegisterStartupScript(this.GetType(), "myScript", "<scriptlanguage=JavaScript>closeThis();</script>");
}
The page doesn't close but instead redirects to the default page which is the LogIn page but I want it to redirect to the LogOut page. How can I just cause the child page to just close or redirect it to the LogOut page or any other page? Another possiblity could be to change the setting of the web.config default page from c# code so that the page will redirect to where I want, is that possible?