This article from: http://code.msdn.microsoft.com/CSASPNETPreventMultipleWind-b1dd2bd6
Csaspnetpreventmultiplewindows overview use: the project has strates how to detect and prevent multiple windows or tab usage In Web applications. demo the sample. Please follow these demonstration steps below. Step 1 : Open the csaspnetpreventmultiplewindows. sln. Step 2 : Expand the csaspnetpreventmultiplewindows web application and press Ctrl + F5 to show the default. aspx. Step 3 : We will see two links on the page. First, you can left click one of them jump to correct Link (like nextlink. aspx and nextlink2.aspx). Step 4 : Then, you can right click these links and choose open in new tab or open in New window, and you will find the link not available. Step 5 : You can even copy the right URL and paste it In The browser address bar For Test. But you can not achieve your goal. Step 6 : Validation finished. Code logical: Step 1 . Create a C # " ASP. NET empty Web Application " In Visual Studio 2010 Or Visual Web Developer 2010 . Name it As " Csaspnetpreventmultiplewindows " . Step 2 . Add one folder, " Usercontrols " . Add two user controls In This Folder, " Defaultpage. ascx " , " Nextpage. ascx " . Step 3 . Add five web forms In The root directory, " Default. aspx " , " Invalidpage. aspx " , " Main. aspx " , " Nextlink. aspx " , " Nextlink2.aspx " . Step 4 . Move defaultpage. ascx user control on default. aspx file and move nextpage. ascx user control on all other files extension name are " . Aspx " . In defalut. aspx. CS page, we have a method generate unique random number: [Code] Public String Getwindowname (){ String Windowname = guid. newguid (). tostring (). Replace ( " - " , "" ); Session [ " Windowname " ] = Windowname; Return Windowname ;}[ / Code] and window. name will recieve This Unique String , We use window. Name to prevent mutiple windows and tabs. [Code] // Set window. Name property Window. Open ( " Main. aspx " , " <% = Getwindowname () %> " ); // If this window name not equal to sessions, will be goto invalidpage If (Window. Name! = " <% = Getwindowname () %> " ) {Window. Name = " Invalidpage " ; Window. Open ( " Invalidpage. aspx " , " _ Self " );}[ / Code] Step 5 . Write the codes like the sample. You canGet More details From Comments In The sample file. Step 6 . Build the application and you can debug it. References: msdn: User Control http: // Msdn.microsoft.com/en-us/library/fb3w5b53.aspx