Problem with IsOnline Option

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JustRun
    New Member
    • Mar 2008
    • 127

    Problem with IsOnline Option

    Hi,

    I have a problem with the (IsOnline) feature at my web site, Actually it works well as long as i'm doing activities even if i just navigate through the web site. The problem occure when i leave my browser open with doing nothing at the web site, just leave it open, it consider me Offline and remove the Check mark from the field "IsOnline"
    I dont know how should i mentain user status or do something fix this.

    I user SQLSERVER 2000, and the membership method as the following
    Code:
        protected void Page_Load(object sender, System.EventArgs e)
        {
            lblStatus.Visible = false;
    
            if (!IsPostBack)
                bind();
        }
    
        private void bind()
        {
            dt = MyGetAllUsers();
    
            grdUsers.DataSource = dt;
            grdUsers.DataBind();
        }
    
        protected DataTable MyGetAllUsers()
        {
            muc = Membership.GetAllUsers();
    
            dt.Columns.Add("UserName", Type.GetType("System.String"));
            dt.Columns.Add("Email", Type.GetType("System.String"));
            dt.Columns.Add("CreationDate", Type.GetType("System.DateTime"));
            dt.Columns.Add("IsOnline", Type.GetType("System.Boolean"));
            dt.Columns.Add("IsLockedOut", Type.GetType("System.Boolean"));
    
            foreach (MembershipUser mu in muc)
            {
                DataRow dr;
                dr = dt.NewRow();
                dr["UserName"] = mu.UserName;
                dr["Email"] = mu.Email;
                dr["CreationDate"] = mu.CreationDate;
                dr["IsOnline"] = mu.IsOnline;
                dr["IsLockedOut"] = mu.IsLockedOut;
    
                dt.Rows.Add(dr);
            }
            return dt;
        }
    }
    Last edited by DrBunchman; Sep 9 '08, 10:57 AM. Reason: Added [Code] Tags - Please use the '#' button
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi JustRun,

    You've posted your question in the ASP Forum which is for Classic ASP only - I've moved it for you but in future please post all ASP.NET questions in the .NET Forum.

    Please don't forget to wrap your code in CODE tags - it makes your posts much easier to read - and please read the Posting Guidelines if you have not done so already.

    Dr B

    Comment

    • JustRun
      New Member
      • Mar 2008
      • 127

      #3
      Ok,

      Thanks, and sorry for the inconvinience.

      Comment

      Working...