DropDownList Selected property on PostBack

B

BCM

I have a page with several DropDownList controls that my users select from
to customize their searches. When they click the "Submit" button all is well
re: the results of their search, but the DropDownLists themselves "reload"
from their data source (a sql table) and display with the first item in the
list selected. How can I have them "remember" the state they were left in by
the user right before they clicked "Submit"? I can do this with my hands
behind my back in good old ASP, so I'm SURE there's a new and improved way
with this server control: I just can't find it!

Thanks in advance...

By the way, I load the data up in the Page_Load event, with the usual

if (!Page.IsPostBack)
 
A

alan.washington

Add an if statement for the dropdown list binding:

if(!IsPostBack) {
//add your code to do the binding here
}

Alan Washington
http://www.aewnet.com
I have a page with several DropDownList controls that my users select from
to customize their searches. When they click the "Submit" button all is well
re: the results of their search, but the DropDownLists themselves "reload"
from their data source (a sql table) and display with the first item in the
list selected. How can I have them "remember" the state they were left in by
the user right before they clicked "Submit"? I can do this with my hands
behind my back in good old ASP, so I'm SURE there's a new and improved way
with this server control: I just can't find it!

Thanks in advance...

By the way, I load the data up in the Page_Load event, with the usual

if (!Page.IsPostBack)

User submitted from AEWNET (http://www.aewnet.com/)
 

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

Top