I have an EventDetails.aspx page with event information that my user can open with Window.Open () from my Timetable.aspx page. On the EventDetails.aspx page, I have a button that allows me to close the window using the following code:
protected void CloseWindow_Click(object sender, EventArgs eventArgs)
{
Response.Write("<script language='javascript'>window.open('','_self');window.close();</script>");
}
When I open my window with Window.Open () from the Timetable.aspx page, the window close button works fine, however, if I navigate the EventDetails.aspx page myself, I cannot use the close window button - nothing happens!
Is there a way to determine if a user went through with Window.Open () to change the visibility of my button or, even better, is there another way to close a tab that you should not rely on using Window.Open ()?
source
share