>
> 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).aspxBut your way works too. <g>
If it's not broken, fix it until it is.
My Blog