496
General UO Chat / Re: Provo and Discord
« on: August 15, 2008, 02:53:39 PM »
I so miss killing people, stealing thier boat key, recalling on it and waiting for them just to kill them again on thier boat hahaha.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
usually when I talk to someone, somehow the term "back in the day"....
I've heard rumors that a 1 or 2 character slot shard is in the works... if this shard goes live.. I may have a new home.
1 private void CheckRolesForSelectedUser()
2 {
3 // Determine what roles the selected user belongs to
4 string selectedUserName = UserList.SelectedValue;
5 string[] selectedUsersRoles = Roles.GetRolesForUser(selectedUserName);
6
7 // Loop through the Repeater's Items and check or uncheck the checkbox as needed
8 foreach (RepeaterItem ri in UsersRoleList.Items)
9 {
10 // Programmatically reference the CheckBox
11 CheckBox RoleCheckBox = ri.FindControl("RoleCheckBox") as CheckBox;
12 // See if RoleCheckBox.Text is in selectedUsersRoles
13 if (selectedUsersRoles.Contains<string>(RoleCheckBox.Text))
14 RoleCheckBox.Checked = true;
15 else
16 RoleCheckBox.Checked = false;
17 }
18 }
Note: The selectedUserRoles.Contains<string>(...) syntax will not compile if you are using ASP.NET version 2.0. The Contains<string> method is part of the LINQ library, which is new to ASP.NET 3.5. If you are still using ASP.NET version 2.0, use the Array.IndexOf<string> method instead.
if (Array.IndexOf<string>(selectedUsersRoles, RoleCheckBox.Text))