Checkboxlist

  • Thread starter Thread starter suma kn via .NET 247
  • Start date Start date
S

suma kn via .NET 247

(Type your message here)
hi,
im using checkboxlist control in my aspx page, and my code is as follows
/*********
int i as integer
For i = 0 To CheckBoxList2.Items.Count - 1
If CheckBoxList2.Items(i).Selected Then
' List the selected items
s = s & CheckBoxList2.Items(i).Text
s = s & "<br>"
End If

Next
Label1.Text = s.ToString
**********/
but im getting a error saying "Object reference not set to an instance of an object" inspiteof selecting the items in the checkboxlist,plz help me out.., its very urgent.
i have written this code in click event of the button.
 
Hi,

I have checked your code.
It is working fine.

Probably the first statement
int i as integer might be giving a compiliation error
the declaration has to be Dim i as integer.

However check the line number where the error is generated.
The error might be some other place not in the few lines of code you have
given.

Regards
SAI
 
Back
Top