List box adding

U

undercups

This is a hybrid problem i.e. the answer lies either in javascript or
vb.net so forgive me if this is the wrong group.

I have this javascript:

function moveItems(fromItem, toItem)
// Moves selected items from one ListBox to another.
{
var NoofItems = fromItem.options.length
for (i=0; i < NoofItems; i++)
{
if (fromItem.children.selected)
{
var anode = fromItem.children.cloneNode(true)
toItem.appendChild(anode)
fromItem.removeChild(fromItem.children)
NoofItems = fromItem.children.length
i--
}
}
}
which when called appears to move an item from 1 listbox to another.
However in vb.net when I run this code
If TeamDivisions.Items.Count > 0 Then
For intCount = 0 To TeamDivisions.Items.Count -
1
.WriteStartElement("TeamDivisions")
TeamDivisions.SelectedIndex = intCount
.WriteAttributeString("DivisionId",
TeamDivisions.SelectedItem.Value)
.WriteEndElement()
Next
End If

the TeamDivisions.Items.Count returns 0 even when I know there are rows
in the control.

Any ideas why this control cannot be accessed in vb.net? In vb.net's
immediate window I can access the listbox from which the items are
removed to the above control using Items.Count, SelectedIndex,
SelectedItem.Value without a problem but the receiving list listbox
i.e. TeamDivisiones doesn't work at all.

Does the problem lie with my javascript?

Thanks for your help

Duncan
 

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

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,147
Latest member
CarenSchni
Top