Note that there are some explanatory texts on larger screens.

plurals
  1. POMembership users showing online when they're not?
    primarykey
    data
    text
    <p>I have an issue, where by each user in my user list is showing as on-line when I know they're not.</p> <p>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? </p> <p>Is there any way to get the profile information without triggering the IsOnline property to be true?</p> <p><strong>Update:</strong> Sorry, code is here. Please be gentle, I'm relatively new to c# &amp; asp.net and I'm still learning.</p> <p>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.</p> <pre><code>MembershipUserCollection usersList = Membership.GetAllUsers(); MembershipUserCollection filteredUsers = new MembershipUserCollection(); foreach (MembershipUser user in usersList) { if (!Roles.IsUserInRole(user.UserName, "Admin") &amp;&amp; !Roles.IsUserInRole(user.UserName, "Engineering")) { if (txtFilterCustomerNo.Text.Length &gt; 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></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload