i have a check box list in my asp.net page …i need to select the check box based on their text…am getting these string values form the database and storing it in a array…..the below code works fine for a single text ..What should i do in case of array..how should i pass the array values in the if loop
for (int i = 0; i < chkbx.Items.Count; i++)
{
if (chkbx.Text == "Dress" )
{
chkbx.Items[i].Selected = true;
}
}
Below code should work for you –