asp.net 中如何获取CheckBoxList的值
更新:HHH   时间:2023-1-7


asp.net 中如何获取CheckBoxList的值


        string item = string.Empty;

        if (CheckBoxList1.SelectedIndex == -1)

        {

            Alert("请选择");

            return;

        }

        else

        {

            foreach (ListItem li in CheckBoxList1.Items)

            {

                if (li.Selected)

                {

                    item += li.Value.ToString() + ",";

                }

            }

            Selected = Selected.Substring(0, Selected.Length - 1);

        }


返回编程语言教程...