How to determine if browser window already open

  • Thread starter Thread starter MikeTI
  • Start date Start date
M

MikeTI

Sep 5, 2009

Hi all

I am new to ASP Net and am using VS2008.

On the click of a button in a form I want to:
1. Check if the second form is already on the browser, to ensure that
another instance of the form does not display.
2. Set focus to the second form without the second form doing any postback.

I have seen some codes in the internet, but the second form does a postback.

function ShowOrderForm()
{
/* If the window doesn't exist or has been closed, open it */
if((typeof newwindow == 'undefined') ||!(newwindow.open) ||
newwindow.closed)
{
newwindow=window.open("Test05.aspx", "my_order");
}

if (window.focus) {newwindow.focus()}
}

Thank you in advance.
MikeTI
 
Back
Top