On 23 Jun 2003 12:57:45 -0700, [email]KathyBurke40@attbi.com[/email] (KathyB) wrote:
>Hi, I'm back.
>
>I have two dropdownlist server controls. #1 populates on pageload -
>works fine.
>#2 also populates fine (on #1 selecteditemchanged event).
>
>My problem is that I need to RETAIN the value selected in #1 so the
>user sees it, and also I will need to capture it as a variable to pass
>on to the next pages reload...I though ViewState did that for me, but
>doesn't appear to be working.
>
>I have #1 set to viewstate = true and autopostback = true.
>
>I've set the code to be If Not IsPostBack, etc. Could someone PLEASE
>tell me where I'm going wrong and/or how to accomplish the above? Code
>follows.
>
>Thanks! Kathy
Its been a while since you posted but I will answer anyway. The
problem is on the following two lines. You are binding the entire form
and the will reset the users selection on the listbox.
> Me.DataBind()
> Me.DataBind()
Instead you should only bind that particular listbox, as in:

listbox1.databind
listbox2.databind

that way the second databind won't affect the users selection in the
first textbox.

Mike