/// <Summary>
/// Obtain the selected 2 in the checkboxlist check box group and generate a string consisting of 0 and 1
/// </Summary>
/// <Param name = "cblname"> checkboxlist instance </param>
/// <Returns> Returns a string consisting of 0 and 1. </returns>
Protected string getcheckboxlist (checkboxlist cblname)
{
String strresult;
Foreach (listitem Li in cblname. Items)
{
If (Li. Selected = true)
{
Strresult + = 1;
}
Else
{
Strresult + = 0;
}
}
}
/// <Summary>
/// Returns the checkboxlist option value based on a string consisting of 0 and 1.
/// </Summary>
/// <Param name = "strcbl"> string in the database </param>
/// <Param name = "cblname"> instance of the checkboxlist Control </param>
Protected void setcheckboxlist (string strcbl, checkboxlist cblname)
{
Char [] charcbl = strcbl. tochararray (); // converts a string to a character array
For (INT I = 0; I <cblname. Items. Count; I ++) // traverses the check box Group
{
If (charcbl [I]. Equals ('1') // The index is the same. If the character value is one, select the check box
{
Cblname. items [I]. Selected = true; // select the check box
}
}
}