cesark
Programmer
- Dec 20, 2003
- 621
The asp.net ListBox that I am trying to get the number of items on it, is populated with items on client side, with a javascript function, the items are there with its text and value, and the js function makes the items added in this ListBox selected by default. To count the items on it I don’ t know how I have to do it. Somebody can help me please?
I am trying to do it thus:
Request.Form("ListBox").Split(",").Length
And I receive this error:
Object reference not set to an instance of an object
Line 213: If (i > Request.Form("ListBox").Split(",").Length ) Then
If I try it thus:
ListBox.Items.Count
The (ListBox.Items.Count) value is always ‘0’ because, I suppose, none items are found, but the items are there with its text and value added by the js function.
How can I do it?
Thank you,
Cesar
I am trying to do it thus:
Request.Form("ListBox").Split(",").Length
And I receive this error:
Object reference not set to an instance of an object
Line 213: If (i > Request.Form("ListBox").Split(",").Length ) Then
If I try it thus:
ListBox.Items.Count
The (ListBox.Items.Count) value is always ‘0’ because, I suppose, none items are found, but the items are there with its text and value added by the js function.
How can I do it?
Thank you,
Cesar