Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is Empty or Null
Message
 
 
To
20/03/2008 11:08:23
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01303548
Message ID:
01303999
Views:
14
>> 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
Previous
Reply
Map
View

Click here to load this message in the networking platform