从VB.NET中的uniqueID CheckBoxList获取所有选定的值

时间:2015-11-26 06:49:15

标签: asp.net vb.net

我已经创建了一个CheckBoxList列表:

DDL.ID = "DDL_" & SelectedCategory & "_" & SubAssy & "_" & ProductType
                        RBL.ID = "RBL_" & SelectedCategory & "_" & SubAssy & "_" & ProductType
                        CBL.ID = "CBL_" & SelectedCategory & "_" & SubAssy & "_" & ProductType
来自DDL.ID的

ID生成如下:CBL_Seatbel_General_General

如何通过此唯一ID获取所有选定的值?

1 个答案:

答案 0 :(得分:0)

我为另一个人找到了解决方案:

            Dim GeneralCBL As CheckBoxList = gvr.FindControl("CBL_Seatbelt_General_General")
            Dim Count0 As Integer = GeneralCBL.Items.Count

            For i = 0 To Count0 - 1
                If GeneralCBL.Items(i).Selected = True Then

                Else

                End If
            Next