Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
Hi All,
How can I detect multiple windows or tabs for some web application?
If i open same web application in one tab, i want to restrict site from opening in another tab.Any one give code plz.
 
Thanks & Regards
Hari
Posted 11-Dec-12 1:31am
Edited 11-Dec-12 2:23am
v3
Comments
AnkitGoel.com at 11-Dec-12 7:33am
   
may be u can detect it by checking IP Address of each session.
Hari Krishna Prasad Inakoti at 11-Dec-12 7:35am
   
how?
can u explain?
AnkitGoel.com at 11-Dec-12 7:40am
   
In your global.asax file, overload session_start method create a global app level list of sessions and ip addresses.
And before adding to this list, Loop through all sessions and check the IP address or current session is same as any previous session or not?
If already exists with same IP then deny otherwise add current to list and let user access the site.
Hari Krishna Prasad Inakoti at 11-Dec-12 7:53am
   
can u give the code?.I'm new one of .net
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Hi All,
I got Solution
 

Public Sub TheSessionId()
        Dim ss As HttpSessionState = HttpContext.Current.Session
        If Not HttpContext.Current.Session("id") Is Nothing Then
            HttpContext.Current.Response.Redirect("InvalidAccess.aspx")
        Else
            HttpContext.Current.Session("id") = ss.SessionID
        End If
    End Sub
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.141022.2 | Last Updated 12 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100