M
Matt
Hello!
I have a user control (ascx) which simply has a couple textboxes and a
listbox... On a page that has a could of them, dynamically created, I am
having a weird problem with the listbox..
There are 2 items in the listbox, however...
Response.Write(CType(MedstarLoginControl.FindControl("lbMedstarFacilities"),
ListBox).Items.Count)
Displays 0
If I do this on the very next line...
CType(MedstarLoginControl.FindControl("lbMedstarFacilities"),
ListBox).SelectedIndex = 1
It does select the second item in the list box....
But if I do this right afterwards....
For Each li As ListItem In
CType(MedstarLoginControl.FindControl("lbMedstarFacilities"), ListBox).Items
Response.Write(li.Text)
Next
Nothing happens, because it still thinks there are no items...... Help!!!!
Thanks,
Matt
I have a user control (ascx) which simply has a couple textboxes and a
listbox... On a page that has a could of them, dynamically created, I am
having a weird problem with the listbox..
There are 2 items in the listbox, however...
Response.Write(CType(MedstarLoginControl.FindControl("lbMedstarFacilities"),
ListBox).Items.Count)
Displays 0
If I do this on the very next line...
CType(MedstarLoginControl.FindControl("lbMedstarFacilities"),
ListBox).SelectedIndex = 1
It does select the second item in the list box....
But if I do this right afterwards....
For Each li As ListItem In
CType(MedstarLoginControl.FindControl("lbMedstarFacilities"), ListBox).Items
Response.Write(li.Text)
Next
Nothing happens, because it still thinks there are no items...... Help!!!!
Thanks,
Matt