Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is Empty or Null
Message
 
 
À
20/03/2008 10:01:33
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01303548
Message ID:
01303888
Vues:
13
>So, I don't know if the ASP ListBox works similarly to the WinForm ListBox, but if it does, what you should actually be checking to see if an item was selected in the ListBox is the .SelectedIndex property. It will -1 if nothing has been selected in the ListBox ... you can also set it to -1 initially.
>
>I always say that the controls for ASP and WinForms behave so differently that I shouldn't answer any questions about them at all. But I was halfway through this thread before I realized that you were talking about ASP. <g> So, I may be wrong about a web ListBox ...
>
>~~Bonnie
>

Hi Bonnie,

if (this.lsbUsers.SelectedIndex > - 1 && this.LsbRoles.SelectedIndex > - 1) seems to work in my tests :)

I guess I over-complicated the issue yesterday based on the original test code. But why the original developer would not use this simple test then?

Strange.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform