dropdown listbox

  • Thread starter Thread starter Tony M
  • Start date Start date
T

Tony M

vb .net 2005 aspx

I have a dropbox that is binded to a table
i.e. ...... item = "New York " and Item value = "NY"

in the If not ispostback I read an SQL table and use the State Item value to
lookup the index in the dropbox and
set the selectedindex .

I tested this by making a list instead of binding to a table and it works.

DDState.SelectedIndex =
DDState.Items.IndexOf(DDState.Items.FindByValue(IsRecordReader("State")))

The only thing I can think of is that i perform the lookup and then the
binding to the table occurs which makes my lookup not work.
is there anyway I can force the binding in the pageload then do my
lookup/search?

Thanks
 
Tony,

There are two things you have to think about with databinding to an already
classic ASPNET dropdown.

You have forever to fill it again at PostBack time and you have forever to
the DataBind method before it is again posted to the client.

Cor
 
Back
Top