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
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment