これは私のコードです:
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