Initialize Drop-Down with current value
Posted on 2003-10-24
I'm new to ASP.Net and C#. I have a drop-down control to select a State, which has all the state values loaded into it. The 'value' of each of my items is the 2-character state abbreviation. The 'text' is the full state name.
On one of my pages, I want to display the current data from the database and let the user edit it.
How do I get the current state to show in the drop-down control? I think I need to match my existing value to one of the "values" in the drop-down, but I'm not sure what the syntax is for going through the values and finding the matching one.
I'd like to get an answer soon...