Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is Empty or Null
Message
 
 
À
20/03/2008 11:08:23
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:
01303999
Vues:
13
>> 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?

>
>For the same reason you didn't ... they didn't know the correct way to do it. <g>
>
>~~Bonnie


Here is a MS sample of doing it:
int[] user_indices = UsersListBox.GetSelectedIndices();

  if (user_indices.Length == 0)
  {
    Msg.Text = "Please select one or more users.";
    return;
  }
from http://msdn2.microsoft.com/en-us/library/system.web.security.roles.adduserstoroles(VS.80).aspx

But your way works too. <g>
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform