Really simple question on Drop Down List Boxes
-
Just a quick question...Have been trying to figure this out for the past 30 minutes but with no luck. Figured I'll just post in here for help. How exactly do you get the contents of the item selected in the Drop Down List? Here's the code: lblResult.Text = ddlBackgroundColor.SelectedItem.Text; However I am getting a blank lblResult everytime. I am just baffled where did I miss. Grrr.... Anyway advice is greatly appreciated. Thank you.
-
Just a quick question...Have been trying to figure this out for the past 30 minutes but with no luck. Figured I'll just post in here for help. How exactly do you get the contents of the item selected in the Drop Down List? Here's the code: lblResult.Text = ddlBackgroundColor.SelectedItem.Text; However I am getting a blank lblResult everytime. I am just baffled where did I miss. Grrr.... Anyway advice is greatly appreciated. Thank you.
Where are you populating the Drop downlist ? the items are static one or dynamically you are adding ? try to debug the application
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
-
Where are you populating the Drop downlist ? the items are static one or dynamically you are adding ? try to debug the application
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "
Hi, thanks for the reply. I am not sure what does populating mean, but all I did was open a form, dragged the Drop Down List, Button, and Label to the form. I added a few items to the DDL, via the "items" properties. They were all hard coded beforehand, so I would assume they are static. I am just trying to get the label to show what was chosen by the click of the button. Thanks
-
Hi, thanks for the reply. I am not sure what does populating mean, but all I did was open a form, dragged the Drop Down List, Button, and Label to the form. I added a few items to the DDL, via the "items" properties. They were all hard coded beforehand, so I would assume they are static. I am just trying to get the label to show what was chosen by the click of the button. Thanks
ok try to debug(F5) your application by putting debug point where you have written the code ...... and see dropdown list contains all the values Assuming that you know how to debug and the code that you have written is in button click event
Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "