Checkboxlist

  • Thread starter suma kn via .NET 247
  • 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.
 
G

Guest

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top