Looking for a CheckBoxList(DataBinded) in a DataList sample on the NET

Discussion in 'ASP .Net' started by Patrick Olurotimi Ige, Jun 22, 2005.

  1. I have a CheckBoxList(which is Databinded) in a Datalist.
    My DataBinded is done in the onItemDataBound

    I'm using this method below to select the selected item in a DataBinded
    CheckBoxList.

    Everything works fine but when i tick a checkbox i get the error at
    line:-
    For i = 0 To checkboxlist1.Items.Count - 1
    Object reference not set to an instance of an object.

    Looking for sample or resources related.
    Thanks


    <asp:checkboxlist OnSelectedIndexChanged="chk_SelectedIndexChanged"
    id="checkboxlist1" Runat="server" AutoPostBack="True"
    ></asp:checkboxlist></td>



    Public Sub chk_SelectedIndexChanged(ByVal sender As System.Object, ByVal
    e As System.EventArgs) Handles checkboxlist1.SelectedIndexChanged
    Dim i As Integer
    For i = 0 To checkboxlist1.Items.Count - 1
    If checkboxlist1.Items(i).Selected Then
    Message.Text = Message.Text & checkboxlist1.Items(i).Selected &
    "<br>"
    Else
    Message.Text = Message.Text & "false <br>"
    End If
    Next
    End Sub


    *** Sent via Developersdex http://www.developersdex.com ***
    Patrick Olurotimi Ige, Jun 22, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,843
  2. =?Utf-8?B?UGF0cmljay5PLklnZQ==?=

    How to add DataBinded CheckBoxList in Datalist

    =?Utf-8?B?UGF0cmljay5PLklnZQ==?=, Jun 17, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,600
    Patrick Olurotimi Ige
    Jun 17, 2005
  3. Patrick.O.Ige
    Replies:
    5
    Views:
    19,073
    Patrick.O.Ige
    Jun 19, 2005
  4. Patrick.O.Ige
    Replies:
    5
    Views:
    1,083
    sana_elka
    Oct 30, 2006
  5. Jake
    Replies:
    0
    Views:
    530
Loading...

Share This Page