Microsoft
Software
Hardware
Network
Question : Question about ASP.NET Drop Down List Control
I’m using
Microsoft Visual Web Developer 2010
and
VB
. I created a database with a 2-character State field,
i.e
., OH for Ohio. I also have a web form on which I placed a drop down list control. I primed the drop down list control’s Items property with the names of the 50 states using the full name (
i.e.,
“Ohio”) as the Text property of the drop down list’s collection item and the corresponding 2-letter abbreviation (
i.e
., “OH”) as the Value property. When I view the form in a browser the drop down list looks fine and you can select a state from the list of 50, but as soon as I try to bind the database field to the drop-down list it doesn’t work correctly and I don’t see the collection of Items any more.
My goal is to make it so that a user can pick from the drop down list of 50 states and, when they submit the form, the database would be populated with the 2-character state abbreviation. I’ve tried setting the various properties in every way I can think of without success. It seems that when I set the drop-down list’s DataTextField (or DataValueField) property to the State field of my database, the drop down list populates from the database instead of my collection of items. How can I set the drop down list so that the user can choose from the collection of 50 states and have the corresponding abbreviation posted to the database?
Answer : Question about ASP.NET Drop Down List Control
to get the value then just use
string abbreviation = DropDownList1.SelectedValu
e;
Random Solutions
Netbios Windows 2008 R2 HYPER-V not pingable
SBS 2008 - Unable to set a static IP
Javascript and Mozilla
Microsoft Exchange Outlook Anywhere SSL Issue
MS Office 2010
syslink Router
Unable to install any framework .NET in XP Mode (Virtual PC)
Apple iWeb - how to save HTML to Disk or to publish the web site via FTP?
outlook not running rules
I can't find the audio driver for a Satellite P30