ASP.NET (C#) Membership users showing online when they're not?

ninewee

New Member
I have an issue, where by each user in my user list is showing as on-line when I know they're not.When the page is loaded, they show as offline, but if I refresh the page, they all show as on-line. I'm assuming this is because I'm programmatically accessing their profile information (CommonProfile) to get the data to show on the gridview? Is there any way to get the profile information without triggering the IsOnline property to be true?Thanks,StuartEDITSorry, code is here... please be gentle, I'm relatively new to c# & asp.net and I'm still learning...The code is collecting information from Membership user and the common profiles and adding the fields to a datatable so that i can display the results in a gridview.\[code\]MembershipUserCollection usersList = Membership.GetAllUsers(); MembershipUserCollection filteredUsers = new MembershipUserCollection(); foreach (MembershipUser user in usersList) { if (!Roles.IsUserInRole(user.UserName, "Admin") && !Roles.IsUserInRole(user.UserName, "Engineering")) { if (txtFilterCustomerNo.Text.Length > 0) { ProfileCommon PC = Profile.GetProfile(user.UserName); if (PC.CompanyAccountNo == txtFilterCustomerNo.Text.ToUpper()) { filteredUsers.Add(user); } } else { filteredUsers.Add(user); } } } txtFilterCustomerNo.Text = null; foreach (MembershipUser user in filteredUsers) { userProfile = Profile.GetProfile(user.UserName); string[] userRoles = Roles.GetRolesForUser(user.UserName); DataRow orderLine = dataSet.Tables["UserAccounts"].NewRow(); orderLine["USER_NAME"] = user.UserName; orderLine["CREATED"] = user.CreationDate; orderLine["LAST_LOGIN"] = user.LastLoginDate; orderLine["PASSWORD_CHANGED"] = user.LastLoginDate; orderLine["ACTIVE"] = user.IsApproved; orderLine["ONLINE"] = user.IsOnline; orderLine["LOCKED"] = user.IsLockedOut; orderLine["CUSTOMER_NO"] = userProfile.CompanyAccountNo; orderLine["HAS_INVENTORY"] = userProfile.HasOwnInventory; orderLine["ORDER"] = userRoles.Contains("Order"); orderLine["REPAIR"] = userRoles.Contains("Repair"); orderLine["WARRANTY"] = userRoles.Contains("Warranty"); orderLine["COMMISSIONING"] = userRoles.Contains("Commissioning"); orderLine["ACCOUNT"] = userRoles.Contains("Account"); dataSet.Tables["UserAccounts"].Rows.Add(orderLine); } if (dataSet.Tables.Contains("UserAccounts")) { GridView1.DataSource = dataSet.Tables["UserAccounts"]; }\[/code\]
 
Back
Top