Asp.net 从VB.NET中的uniqueID复选框列表中获取所有选定值
我创建了一个复选框列表,如下所示:Asp.net 从VB.NET中的uniqueID复选框列表中获取所有选定值,asp.net,vb.net,Asp.net,Vb.net,我创建了一个复选框列表,如下所示: DDL.ID = "DDL_" & SelectedCategory & "_" & SubAssy & "_" & ProductType RBL.ID = "RBL_" & SelectedCategory & "_" & SubAssy & "_" & ProductType CB
DDL.ID = "DDL_" & SelectedCategory & "_" & SubAssy & "_" & ProductType
RBL.ID = "RBL_" & SelectedCategory & "_" & SubAssy & "_" & ProductType
CBL.ID = "CBL_" & SelectedCategory & "_" & SubAssy & "_" & ProductType
从DDL.ID生成的ID如下:CBL_searbel_General_General
如何通过此唯一ID获取所有选定值?我为其他人找到了解决方案:
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
我为另一个人找到了解决方案:
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