Many People who start developing on ASP.NET C#, they usually find it difficult to bind and get the selected item in the listbox and Dropdownlist control. This is how simple it is
String myselecteditem = listBox1.SelectedItems;
And you can do the same thing with a Dropdownlist
String mydropdownlist = dropdownlist1.SelectedItems;
Now all this will return what a user see on the List box, if it’s a list of numbers like {1,2,3,4,5} then the value that will be contained in there is that.
Thanks
Showing posts with label 3.5 C#). Show all posts
Showing posts with label 3.5 C#). Show all posts
Monday, March 16, 2009
Subscribe to:
Posts (Atom)
