databinding + listboxes

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
hi guys,

Have a listbox on my webforum, the data in that listbox is being retrieved from the database, the data being retrieved is :admin, user, visitor. Now just prior to when i want the data to be displayed in the list box i go: listbox.items.clear, to clear out the listbox. However this command does not seem to clear out the data, so i am left with multiple entries of: admin, user, visitor.

Any suggestions??

Mike55
 
If you put the code that binds the listbox to the data inside the postback e.g.

if not page.ispostback then
listbox.databind
end if

This way, your listbox will only get populated the once, regardless.
 
Back
Top