I have a array of checkboxes, 33 in total.
Because the checkboxes are all over the page, it needs to be in an array (right?).
The code-behind looks like this:
CheckBox[] variableName = new CheckBox[33];
variableName[0] = idCheckBox1;
variableName[1] = idCheckBox1;
variableName[2] = idCheckBox1;
variableName[3] = idCheckBox1;
and so on…
ASP.NET:
<asp:CheckBox ID="idCheckBox1" runat="server" Value="1" />
<asp:CheckBox ID="idCheckBox2" runat="server" Value="2" />
...
The checkboxes are totally optional.
Now how do i get the value of the checked boxes only in a variable?
It does NOT need to be an array.
This is how you get all the CHECKED checkboxes in your form from the CodeBehind: