I try to get multiple checked items into one coloumn in my db. But i only get the first selected.
This is my sub:
Protected Sub SubmitBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim Valg as string
If valgBox.Items(0).Selected Then valg += "10til15" & ", "
If valgBox.Items(1).Selected Then valg += "10til12" & ", "
If valgBox.Items(2).Selected Then valg += "12til15" & ", "
If valgBox.Items(3).Selected Then valg += "13til15" & ", "
SqlDataSource1.Insert()
Response.Redirect("farvel.html")
End Sub
My CheckBoxList:
<asp:CheckBoxList ID="valgBox" runat="server" AutoPostBack="True">
<asp:ListItem value="10-15">Jeg deltager fra kl. 10.00 - 15.00</asp:ListItem>
<asp:ListItem value="10-12">Jeg deltager fra kl. 10.00 - 12.00</asp:ListItem> ...
Go to the complete details ...