Solved

Basic C# and asp questions with oracle: #2

Posted on 2004-03-21
2
186 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 250 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 250 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Reset asp.net login password 4 42
designing in object programming 12 75
Media.Imaging 1 18
use of unassigned local variable 'id' 6 38
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 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