Hi
Try to change the checkbox list like this
<asp:CheckBoxList ID="chkEmplyeeMaster" runat="server"
RepeatDirection="Horizontal" CssClass="chkclass">
<asp:ListItem Text="View"></asp:ListItem>
<asp:ListItem Text="Read"></asp:ListItem>
<asp:ListItem Text="Update"></asp:ListItem>
<asp:ListItem Text="Delete"></asp:ListItem>
</asp:CheckBoxList>
Just create a common function like this
private void SetCheckBoxListSelection(CheckBoxList cbxlist,string OptionName, bool Value)
{
var item=cbxlist.Items.Cast<ListItem>().Where(li => li.Text.ToLower().Equals(OptionName.ToLower())).FirstOrDefault();
if (item != null) item.Selected = Value;
}
Then call this function
by passing the
SetCheckBoxListSelection(chkEmplyeeMaster,"View",TView==1?true:false);