Posted on: 1/16/2014 2:14:13 PM | Views : 598

Hi, I want to add or remove roles for users in the table aspnet_UsersInRoles but I know how to do it. My code: For Display all Roles:
private void DisplayRolesInGrid() { var allroles = from t1 in db.aspnet_Roles select new { RoleName=t1.RoleName }; RoleList.DataSource = allroles; RoleList.DataBind(); } <asp:GridView ID="RoleList" runat="server" OnRowDataBound="RoleList_ItemDataBound" AutoGenerateColumns="False"> <Columns> <asp:TemplateField HeaderText="Role"> <ItemTemplate> RoleName <asp:CheckBox ID="chkRoleName" OnCheckedChanged="chkRoleName_CheckedChanged" Text='<%# DataBinder.Eval(Container.DataItem, "RoleName") %>' runat="server" /><br /> <%-- UserId <asp:Label runat="server" ID="Label1" Text='< ...

Go to the complete details ...