Click here to Skip to main content
15,887,585 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

my requirement is i have one username and password ..in that username logedin then same time where ever login i need to display some message like this username already login..in sum where.

i dont want to give parmission to login different locations....

how to do this any idea please share with me...

thanks
Posted

in User table add two more field as a Status and IPAddress

when ever user login i mean session create change status to Online at the same time track ipaddress for feature response.

at the same time when ever user logout change status to Offline

so, here u got logic as if status=Offline give permission to login

else if status==Online you can restrict the permission to login different locations.
 
Share this answer
 
v3
Comments
vsiddi 5-Mar-12 4:31am    
venkat s replied to Web Star on 05-Mar-12 04:19 AM
thank for replay

suppose my browser closed or system shutdown that time how to change login status...

really i done befor steps..
this is my problome (browser closed or system shutdown)
vsiddi 5-Mar-12 4:31am    
venkat s replied to Web Star on 05-Mar-12 04:19 AM
thank for replay

suppose my browser closed or system shutdown that time how to change login status...

really i done befor steps..
this is my problome (browser closed or system shutdown)
Bojjaiah 5-Mar-12 4:40am    
inherit ICallbackEventHandler this eventhandler it ca automatically create two methods one is return results another one is store the values and close the i mean kill the sessions.

public partial class

//
this event handler is catch the browser information whn browser naviage or close it can handle.

ReturnPackageCard : System.Web.UI.Page, ICallbackEventHandler
{
protected void Page_Load(object sender, EventArgs e)
{
ClientScriptManager cm = Page.ClientScript;
String cbReference = cm.GetCallbackEventReference(this, "arg", "ReceiveServerData", "");
String callbackScript = "function CallServer(arg, context) {" + cbReference + "; }";
cm.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true);
}
public string GetCallbackResult()
{
return "Success";
}
public void RaiseCallbackEvent(string eventArgument)
{
//here kill the sessions
}

}

before writing this you can take .js file
write like this and refere all .aspx pages
function confirmExit() {
//do something
}
function ReceiveServerData(arg, context) {

}
 
Share this answer
 
Comments
vsiddi 5-Mar-12 4:31am    
venkat s replied to Web Star on 05-Mar-12 04:19 AM
thank for replay

suppose my browser closed or system shutdown that time how to change login status...

really i done befor steps..
this is my problome (browser closed or system shutdown)
vsiddi 5-Mar-12 4:31am    
venkat s replied to Web Star on 05-Mar-12 04:19 AM
thank for replay

suppose my browser closed or system shutdown that time how to change login status...

really i done befor steps..
this is my problome (browser closed or system shutdown)
inherit ICallbackEventHandler this eventhandler it ca automatically create two methods one is return results another one is store the values and close the i mean kill the sessions.

public partial class 

//
this event handler is catch the browser information whn browser naviage or close it can handle.

public partial class sample : System.Web.UI.Page, ICallbackEventHandler
{
 protected void Page_Load(object sender, EventArgs e)
    {
      ClientScriptManager cm = Page.ClientScript;
            String cbReference = cm.GetCallbackEventReference(this, "arg", "ReceiveServerData", "");
            String callbackScript = "function CallServer(arg, context) {" + cbReference + "; }";
            cm.RegisterClientScriptBlock(this.GetType(), "CallServer", callbackScript, true);
    }
public string GetCallbackResult()
    {
        return "Success";
    }
 public void RaiseCallbackEvent(string eventArgument)
    {
       //here kill the sessions
    }

}

before writing this you can take .js file
write like this and refere all .aspx pages
function confirmExit() {
//do something
}
function ReceiveServerData(arg, context) {

}
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900