Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dropdown listbox

0 views
Skip to first unread message

Tony M

unread,
Nov 21, 2009, 9:13:55 PM11/21/09
to
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


Cor Ligthert[MVP]

unread,
Nov 22, 2009, 2:48:57 AM11/22/09
to
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


"Tony M" <wHAT...@msn.com> wrote in message
news:eOG8wlx...@TK2MSFTNGP02.phx.gbl...

0 new messages