i am using membership for the first time for add user roles..Now as per my need i am displaying user roles with their names in columns of gridview as checked or unchecked based on the roles assigned to particular user.. Now i want to upgrade the roles by clicking on checkboxes ..in this case i need to update multiple roles with singme username in membership table...
My concern is that is there any method in membership by which we can update multiple roles with single username ...
Here is my code to get the selected role from gridview column..
protected void UpgradeSelectedRecords(object sender, EventArgs e)
{
string admin;
string DPAOUser;
string GenUser;
foreach (GridViewRow row in GridView1.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
CheckBox chkRow = (row.Cells[0].FindControl("chkChild") as CheckBox);
if (chkRow.Checked)
{
string name = (row.Cells[2].FindControl("Label1") as Label).Text;
if ((row.Cells[3].FindControl("chkAdmin") as CheckBox).Checked) {
admin = "Admin";
}
if ((row.Cells[4].FindControl("chkUser") as CheckBox).Checked)
{
DPAOUser = "DPAO User ";
}
if ((row.Cells[5].FindControl("chkgen") as CheckBox).Checked)
{
GenUser = "GeneralUser";
}
}
}
}
BindGridviewData();
}
Any help will be highly appreciated.. Thanks in advance..