这是我的代码:
protected void check1_SelectedIndexChanged(object sender, EventArgs e)
{
for (int i = 0; i < check1.Items.Count; i++)
{
if (check1.Items[i].Selected)
{
comment.Text = "\u2022 "+check1.Items[i].Text +"<br/>"+ comment.Text;
}
}
}
例如,如果我有复选框列表:
*apple
*Mango
*Orange
*Grapes
我选择了苹果、橙子和葡萄,它显示为
grapes
orange
apple
我希望它显示为:
apple
orange
grapes