I have a simple form on an asp.net webpage with asp:TextBox, asp:DropDownList and asp:CheckBoxList controls.
I'm emailing the form output. Everything works great except for the checkbox values that are being created by a simple For loop (see embedded code snippet).
Instead of this result from 'checkedValues' : Apple, Grape, Orange, Banana
I'm getting this: pple, Grape, Orange, Banana
In other words, regardless of which checkboxes are checked within a checkbox list, the first character in the 'checkedValues' string is missing.
Any suggestions would be greatly appreciated!
Dim checkedValues As String = String.empty
For Each item As ListItem In chkauto.Items
If item.Selected Then
checkedValues+= item.Value+", "
If Not [String].IsNullOrEmpty(checkedValues) Then
checkedValues = checkedValues.SubString(1)