Restricting to single instance of a web application
-
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???
-
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???
-
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
-
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
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
-
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
-
Hey Thanx again, I would be greatful if you could explain a little more with illustration for more clarity
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