Help with listbox

G

glbdev

Hi.

I am trying to loop thru a listbox and retreive the value for all
selected items.

Example of listbox items:
<option value="1">Item 1</option>
<option value="2">Item 2</option>
<option value="3">Item 3</option>
<option value="4">Item 4</option>
<option value="5">Item 5</option>

Here is an example of the code used to parse the listbox:

If Me.lstSelectedIssues.Items.Count = 0 Then Return String.Empty
For x = (Me.lstSelectedIssues.Items.Count - 1) To 0 Step -1
sBuffer += Me.lstSelectedIssues.Items(x).Value + ","
Next

I keep getting the TEXT ('Item1") instead of the NUMERIC (1) values
from these items.

What am I doing wrong?

Thanks,
Steve
 
J

Joe Chung

Your code looks fine. What sort of server-side control are you using for
your multi-select list box, and how are you populating it?
 
G

glbdev

Your code looks fine.  What sort of server-side control are you using for
your multi-select list box, and how are you populating it?













- Show quoted text -

Thanks for responding. I am populating the box using a SQLDataSource.

Steve
 

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,770
Messages
2,569,583
Members
45,072
Latest member
trafficcone

Latest Threads

Top