I have a list box control:
The code behind resembles:
<
Works for me too. Does your foo() return the same values every time?
Just as a side note: if possible, you should really do your databinding in OnInit (every time, not just on GETs). If you do it before the call to base.OnInit(...), the contents of your listbox won't have to be serialized and deserialized to and from viewstate and sent across the wire to the client (yes, you will be hitting the database more, but you'll be hitting a system which is located on your local subnet, or even on the same machine. Moreover, the database will likely cache the result).
If you want to build high-performance websites, you need to take a close look at the way you use ViewState. I highly recommend this article: TRULY Understanding ViewState