?
Solved

Basic C# and asp questions with oracle: #2

Posted on 2004-03-21
2
Medium Priority
?
195 Views
Last Modified: 2010-04-15
how do i get the drop down lists to keep the value that was selected on a postback?
thanks
0
Comment
Question by:tricks801
2 Comments
 
LVL 12

Assisted Solution

by:esteban_felipe
esteban_felipe earned 1000 total points
ID: 10646439
Hi tricks801,

1.- EnableViewState should be set to true (At page level, or control level)
2.- Bind your data only on first request
page_load(....)
if(!Page.IsPostBack)
{
    yourDropDownList.DataBind();
}

Esteban Felipe
www.estebanf.com
0
 
LVL 7

Accepted Solution

by:
jj819430 earned 1000 total points
ID: 10650651
You only want to bind a control again when it is being manipulated on the backend.... such as you have a new set of values to throw into the drop down list.

Esteban has it that you are probably not checking for post-back. The other possibility is that you are manipulating the DDownList with another class in which case you will have to track what was the selected Item.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question