Solved

Basic C# and asp questions with oracle: #2

Posted on 2004-03-21
2
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

696 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