get the selected items in checkboxlist


There are many ways to get items from CheckBoxList. Bellow some codes are presented.
On aspx page,
<asp:CheckBoxList ID="chkbokxlist" runat="server"></asp:CheckBoxList> 
1- Code behind 
       foreach (ListItem i in chkbokxlist.Items)
        {
            if (i.Selected)
            {
            //your code here
            }
        }
2- Code behind
        var itm = chkbokxlist.Items.Cast<ListItem>().Where(x => x.Selected);
        foreach (ListItem i in itm)
        {
            if (i.Selected)
            {
            // your code
            }       
        }


NUnit : Introduction

There are several unit test tools in the market, but one of them is NUnit, the most popular tool for doing unit testing. So in this tutorial...