G
Guest
I have CheckboxList Databinded below and that works fine and i can get the
selected values after PostBack.
But what i have noticed is that when you select a checkbox i.e lets say 3 of
them and later unselect them the last one u unselect remains printed out on
the screen.
How can i reset Checkboxlists back to NULL.
I need to do this becos i'm passing the values to a QueryString and if the
unselect and remains in the queryString its a problem.
Any ideas?
<asp:checkboxlist id="chkList" AutoPostBack="True" Runat="server"
DataValueField="ProductFeatureID" DataTextField="Feature"
OnSelectedIndexChanged="Check_Clicked"></asp:checkboxlist></td>
Sub Check_Clicked(ByVal sender As Object, ByVal e As EventArgs)
'print.Text = "Selected Item(s):<br><br>"
Dim i As Integer
Dim a As String
Dim P As String = ""
For i = 0 To chkList.Items.Count - 1
If chkList.Items(i).Selected Then
P &= "," & chkList.Items(i).Value
print.Text = P
End If
Next
End Sub
selected values after PostBack.
But what i have noticed is that when you select a checkbox i.e lets say 3 of
them and later unselect them the last one u unselect remains printed out on
the screen.
How can i reset Checkboxlists back to NULL.
I need to do this becos i'm passing the values to a QueryString and if the
unselect and remains in the queryString its a problem.
Any ideas?
<asp:checkboxlist id="chkList" AutoPostBack="True" Runat="server"
DataValueField="ProductFeatureID" DataTextField="Feature"
OnSelectedIndexChanged="Check_Clicked"></asp:checkboxlist></td>
Sub Check_Clicked(ByVal sender As Object, ByVal e As EventArgs)
'print.Text = "Selected Item(s):<br><br>"
Dim i As Integer
Dim a As String
Dim P As String = ""
For i = 0 To chkList.Items.Count - 1
If chkList.Items(i).Selected Then
P &= "," & chkList.Items(i).Value
print.Text = P
End If
Next
End Sub