how to retrieve checkboxlist value from database and retrieved value should be checked in checkboxlist in asp.net RRS feed

  • Question

  • i have this code but it only checked one checkbox

            Dim lst As New ListItem
            Dim hArr() As String
            Dim str As String = reader("hobbies")
            hArr = str.Split(",")

            For i As Integer = 0 To hobbieList.Items.Count - 1
                If hobbieList.SelectedIndex = str Then
                    hobbieList.SelectedIndex = hobbieList.Items.IndexOf(hobbieList.Items.FindByText(str))
                End If
            For Each str In hArr
                hobbieList.SelectedIndex = hobbieList.Items.IndexOf(hobbieList.Items.FindByText(str))

    • Moved by Stanly Fan Monday, November 13, 2017 6:09 AM
    Thursday, November 2, 2017 4:19 AM

All replies

  • Hi friend,

    Welcome to Winform Forum.

    According to your description, your issue is more related about ASP.NET. And this forum is discussing and asking questions about the Windows Form and ClickOnce, it will be more appropriate to ask your question at ASP.NET Forum.

    Thank you for your understanding.



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, November 3, 2017 1:23 AM