示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                // If user name was submitted then...
                if (Request["Role"] == null)
                {
                    RoleList1.DataBind();
                }
                else
                {
                    // Show user edit form.
                    //LoadByRole(Request["Role"].ToString());
                }
            }

            RoleList1.RoleSelected += new EventHandler <GridViewCommandEventArgs>(RoleList1_RoleSelected);
            RoleList1.RolesDeleted += new EventHandler <ItemActionsEventArgs>(RoleList1_RolesDeleted);
            RoleEdit1.Updated      += new EventHandler <RoleEditEventArgs>(RoleEdit1_Updated);
            //RoleList1.AllowCreate = true;
            //RoleList1.AllowEdit = true;
            //RoleList1.AllowDelete = true;
            //UserList1.ShowColumn(UserColumnsEnum.Edit, false);
            //UserList1.ShowColumn(UserColumnsEnum.IsApproved, false);
        }
示例#2
0
    private void BindRolesToList()
    {
        // Get all of the roles
        string[] roles = Roles.GetAllRoles();


        RoleList.DataSource  = roles;
        RoleList1.DataSource = roles;
        RoleList.DataBind();
        RoleList1.DataBind();
    }