views:

8

answers:

1

this is part of code for my checkbox.

 For Each c As Contact In contacts.Entries
            counter += 1
            tr = New HtmlTableRow
            tc = New HtmlTableCell

            Dim chkbox As New CheckBox
            chkbox.ID = "id_" & counter
            tc.Controls.Add(chkbox)
            tr.Cells.Add(tc)

Next

now this will create 1 to n, checkboxes depending on the records pulled form DB. On the user side, i need them to check minimum one checkbox before clicking submit. howcan i achieve this?

A: 

You can use a CustomValidator. Then you can validate on server- or clientside if the user checked at least one. Have a look at this answer: stackoverflow: asp-net-checkboxgroup-validate-user-chooses-at-least-one-checkbox

Tim Schmelter