<tr>
<td width=60%><asp:CheckBox ID="chk0" runat="server" /> ...</td>
<td width=40%><asp:CheckBox ID="chk1" runat="server" /> ...</td>
</tr>
...
...
...
I have values coming in like this:
var lst = "18,6,0,7,0,4,0,1,5,0,2"
If 18 is there then chk18 is checked and ect… 0 just means no getting checked. Is there an ideal way to code this? whileloop be ideal?
The values are coming from a database table all the data is in that format.
Note, this will not work for your control ‘chk0’ and will blow up if you don’t have a correlating checkbox (ex = 18 is in your data, but you have no control chk18).