Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Accessing Selected Item in List Box
Message
From
10/06/2004 11:41:18
 
 
To
All
General information
Forum:
ASP.NET
Category:
Web forms
Title:
Accessing Selected Item in List Box
Miscellaneous
Thread ID:
00912266
Message ID:
00912266
Views:
44
I'm new to the interfaces in .Net. On a webform, I'm trying to access the value of the selected item in a listbox. I tried the following, which returns an empty string:

String UserToDelete=this.UsersList.SelectedValue

We also tried:

String UserToDelete=this.UsersList.SelectedItem.ToString(), which gave us an exception - Object reference not set to an instance of an object.

What can I do to make UserToDelete equal the visible value in the listbox?

The listbox is a single column, listing users in the system. When I select on "Mr. Dingleberry", I want the UserToDelete string to equal "Mr. Dingleberry".

Thanks,

David
Next
Reply
Map
View

Click here to load this message in the networking platform