Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Restricting to single instance of a web application

Restricting to single instance of a web application

Scheduled Pinned Locked Moved ASP.NET
hostingtutorialquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anushu
    wrote on last edited by
    #1

    Hi, Can anybody throw light on how to restrict a WebForm ( an aspx) page to a single instance. For instance, if i am hosting "http://localhost/WebBased\_UserControl.aspx" in IE and I try to open the same page in another IE window then only one IE Window hosting the above page should open... How is this possible???

    V 1 Reply Last reply
    0
    • A Anushu

      Hi, Can anybody throw light on how to restrict a WebForm ( an aspx) page to a single instance. For instance, if i am hosting "http://localhost/WebBased\_UserControl.aspx" in IE and I try to open the same page in another IE window then only one IE Window hosting the above page should open... How is this possible???

      V Offline
      V Offline
      V 0
      wrote on last edited by
      #2

      What do you want, only 1 page per user? Check the Ip-adres? "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

      A 1 Reply Last reply
      0
      • V V 0

        What do you want, only 1 page per user? Check the Ip-adres? "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

        A Offline
        A Offline
        Anushu
        wrote on last edited by
        #3

        Hey, thanks for the reply, But I am not trying to achieve single user per page.. but only this if a web page is open user must have only that single instance of the web page and should not be allowed to open an another instance

        V 1 Reply Last reply
        0
        • A Anushu

          Hey, thanks for the reply, But I am not trying to achieve single user per page.. but only this if a web page is open user must have only that single instance of the web page and should not be allowed to open an another instance

          V Offline
          V Offline
          V 0
          wrote on last edited by
          #4

          well, keep the ip as long as the user is working? As long as the same Ip makes requests to your application, no other instance can be made... but that's just an idea, there probably are other ways to do it. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

          A 1 Reply Last reply
          0
          • V V 0

            well, keep the ip as long as the user is working? As long as the same Ip makes requests to your application, no other instance can be made... but that's just an idea, there probably are other ways to do it. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

            A Offline
            A Offline
            Anonymous
            wrote on last edited by
            #5

            Hey Thanx again, I would be greatful if you could explain a little more with illustration for more clarity

            V 1 Reply Last reply
            0
            • A Anonymous

              Hey Thanx again, I would be greatful if you could explain a little more with illustration for more clarity

              V Offline
              V Offline
              V 0
              wrote on last edited by
              #6

              For the retrievel of the IP adres I'll have to refer to the MSDN because I don't know how to do that. (there probably be some classes you can use in NET itself) Store the Ip in a session object. Session["UserIp"] = theIPAddress; in a Page Load of your app check for the Ip like this: if(Session["UserIp"] != null){ Response.Redirect("OneInstancePlease.aspx"); } OneInstancePlease.aspx shows a message to the user that he can only have one instance of the Application. You can also search into the Singleton Pattern, but I'm not sure if can work with web-apps. Actually, the Ip is not entirely necessary as every 'value' that can be uniquely determin the user will do. eg. Use a login. good luck. "If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimi Hendrix

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups