My Dropdownlist keeps getting repopulated

N

needin4mation

I remember in 1.1 that I would put not to populate a given dropdownlist
unless it was not Page.IsPostBack. But in 2.0 where I use the DAL and
no codefile, I don't see where to effect this. Any help is
appreciated. I want my dropdownlist to keep what the use selected when
the page refreshes. Thanks.
 
C

Cowboy \(Gregory A. Beamer\)

You mean you are using drag and drop binding (aka declarative binding) and
cannot affect it? It should automatically only call on initial post if you
are doing this, unless you override some defaults.

Or, do you mean you created a DAL and have bound it? You might not have this
set up to do what the above should. In this case, I would move the
declarative binding out and use code to bind. You can then specify.

Or, I am completely off base and do not understand what you are saying. :)
 
N

needin4mation

Actually, I figured out it is only rebinding all the dropdownlist
contents on the subpage. The ddl is on the masterpage. The user
select category 1, then ddl populates with category 2. The user
selects category 2 and in my codefile I have my masterpage redirect to
another page on my site with the selectedValue from the ddl. When the
new page loads from the redirect and because it has the same masterpage
the dropdownlists repopulates. That redirect is not a postback, but a
real first time visit.

Maybe I shouldn't do the redirect, but I don't know another way to pass
the value from my ddl to the subpage without using the redirect with a
querystring variable (the variable, of course, is the selectedValue.)

Thanks for your help.
 

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

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top