Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop Down Lists?

Status
Not open for further replies.
Nov 19, 2003
117
US
When i select something from one of my drop downs lists,
and i output Response.Write(dropdownlist.selectedvalue);

it would return something like this

NYNY

instead i just want NY

Sincerely,
Michael
 
Use dropdownlist.selectedvalue.ToString()

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Maybe I'm wrong but I always use:
Response.Write(dropdownlist.SelectedItem.Value);
to retrieve.

I use dropdownlist.SelectedValue == "NY" to set the DDL to something sometimes as an alternative to SelectedIndex (in a given scenario).

 
Value will work, too.

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top