Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Accessing Selected Item in List Box
Message
De
10/06/2004 11:41:18
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Titre:
Accessing Selected Item in List Box
Divers
Thread ID:
00912266
Message ID:
00912266
Vues:
45
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform