Beispiel #1
0
        //*******************************************************
        //
        // The BindData helper method is used to bind the list of
        // security roles for this portal to an asp:datalist server control
        //
        //*******************************************************

        private void BindData()
        {
            // unhide the Windows Authentication UI, if application
            if (User.Identity.AuthenticationType != "Forms")
            {
                windowsUserName.Visible = true;
                addNew.Visible          = true;
            }

            // add the role name to the title
            if (roleName != "")
            {
                title.InnerText = "Role Membership: " + roleName;
            }

            // Get the portal's roles from the database
            AdminDB admin = new AdminDB();

            // bind users in role to DataList
            usersInRole.DataSource = admin.GetRoleMembers(roleId);
            usersInRole.DataBind();

            // bind all portal users to dropdownlist
            allUsers.DataSource = admin.GetUsers();
            allUsers.DataBind();
        }