protected void Page_Load(object sender, EventArgs e) { lblEditMsg.Visible = false; if (!IsPostBack) { //MembershipUserCollection allUsers = Membership.GetAllUsers(); MembershipUserCollection allUsersWithoutCurrent = Membership.GetAllUsers(); allUsersWithoutCurrent.Remove(User.Identity.Name); List <ADUCUser> list = ADUCUser.GetList(allUsersWithoutCurrent, Profile); ddlEditUser.DataSource = list; ddlEditUser.DataBind(); ((TextBox)cuwCreateUser.CreateUserStep.ContentTemplateContainer.FindControl("Password")).Text = rndPassword.GeneratePassword(10); } if (HttpContext.Current.Items["username"] != null && HttpContext.Current.Items["password"] != null) { string username = HttpContext.Current.Items["username"].ToString(); string password = HttpContext.Current.Items["password"].ToString(); tcUserManagement.ActiveTabIndex = 1; cuwCreateUser.ActiveStepIndex = 1; cuwCreateUser.CompleteSuccessText = String.Format("{0} oprettet med password: {1}", username, password);; } }
public void Remove_Unexisting() { MembershipUserCollection muc = new MembershipUserCollection(); muc.Add(GetMember("me")); muc.Remove("me too"); }
private void BindUsersToDropdownlist() { //bind users to dropdownlist MembershipUserCollection users = Membership.GetAllUsers(); if (User.IsInRole("WebAdmin")) { //do nothing //display all users when the User has Web Admin Privs } else { //filter the users so that web admins are not present in the list //get all users except Web Admins List <string> webAdmins = Roles.GetUsersInRole("WebAdmin").ToList <string>(); foreach (string webAdmin in webAdmins) { users.Remove(webAdmin); } } ddlUsers.DataSource = users; ddlUsers.DataBind(); }
public void Remove_ReadOnly() { MembershipUserCollection muc = new MembershipUserCollection(); muc.Add(GetMember("me")); muc.SetReadOnly(); muc.Remove("me"); }
protected void Page_Load(object sender, EventArgs e) { lblMsg.Visible = false; if (!IsPostBack) { MembershipUserCollection allUsers = Membership.GetAllUsers(); MembershipUserCollection allUsersWithoutCurrent = Membership.GetAllUsers(); allUsersWithoutCurrent.Remove(User.Identity.Name); grdvwManageUsers.DataSource = allUsers; grdvwManageUsers.DataBind(); ddlChangePasswordUser.DataSource = allUsers; ddlChangePasswordUser.DataBind(); ddlDeleteUser.DataSource = allUsersWithoutCurrent; ddlDeleteUser.DataBind(); grdvwManageUsers.FooterRow.Cells[0].ColumnSpan = 3; grdvwManageUsers.FooterRow.Cells.RemoveAt(1); grdvwManageUsers.FooterRow.Cells.RemoveAt(1); } }
public void Remove_Null() { MembershipUserCollection muc = new MembershipUserCollection(); muc.Remove(null); }
protected void btnDelete_Click(object sender, EventArgs e) { users.Remove(User.Identity.Name); }