put this code in the formview insertion event ... List the checkboxes and add the highlighted element to datatable and go to your BLL
CheckBoxList chklRoles = (CheckBoxList)frm.FindControl("chklRoles");
foreach (ListItem liRole in chklRoles.Items)
{
if (liRole.Selected)
{
SecurityDS.SC_RoleRow drwRoles = dtblRoles.NewSC_RoleRow();
drwRoles.Name = liRole.Value;
drwRoles.IsActive = false;
dtblRoles.Rows.Add(drwRoles);
}
}
e.Values["userRole"] = dtblRoles;
ASPX page code .. parameter type
<InsertParameters>
<asp:Parameter Name="userRole" Type="Object" />
</InsertParameters>
and then repeat the processing of the data in the BLL and save it in the database.
source
share