How to maintain state w/DropDownList populated from database?

E

ESmith

I have a dropdownlist that I populate from my database when the page loads.
If I don't have autopostback enabled, I don't see the user's changed
selection, but if I enable autopostback and do not reload the dataitems,
nothing is there, and if I enable retrieving values from the database, the
selection isn't saved. I've tried enableviewstate and autopostback - what's
the best way to do this?
 
P

Patrick.O.Ige

Wrap your DropDownlist in:-

If not Page.IsPostback then
(Your DropDown)
End If

Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top