Click here to Skip to main content
16,020,677 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
hi how to display an specific an image related to each item that is selected from a dropdown list?
for example,if i select the USA from DropdownlistCountry ,the USA flag appear
Posted
Comments
Richard C Bishop 9-Oct-12 13:40pm    
What have you tried? Post your code and then we can help you.

1 solution

if i select the USA from DropdownlistCountry ,the USA flag appear
Steps:
1. Define items to be shown in dropdownlist.
2. Define a selectedindexchange event for the above dropdown
3. Set autopostback property of the above dropdown as true.
4. Now, whenever you select an item, change(2 above) event would fire
5. In this event, get the selected item, based on this selected value get the correct image source
6. Set the image source as per the value

Done! Try now.
 
Share this answer
 
Comments
Nelek 9-Oct-12 13:50pm    
nice answer (not sure if the one he wanted)
Sandeep Mewara 10-Oct-12 1:10am    
Thanks. (Yeah, I too doubt if he was looking for steps/direction - yes only if he wanted to learn.)
Saraa123 12-Oct-12 15:29pm    
thanks Sandeep
Sandeep Mewara 13-Oct-12 1:16am    
Welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900