Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problems with Security Admin and Configuration
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
01242537
Message ID:
01246944
Views:
9
>When you try to delete a user from the security UserAdmin form, you receive the following error:

>System.ArgumentOutOfRangeException: 'lstUsers' has a SelectedValue which is invalid because it does not exist in the list of items.

As it turns out, this is a pandemic problem with the ASP.NET 2.0 ListBox control. To fix the problem, add the following two lines of code to the top of the if() statement in your UserAdmin.aspx.cs form's LoadUserList() method:
private bool LoadUserList()
{
    if (this.oUser.GetAllUserNames() != null)
    {
	this.lstUsers.Items.Clear();
	this.lstUsers.SelectedValue = null;
        dsUsers = this.oUser.GetCurrentDataSet();
        this.lstUsers.DataSource = dsUsers.Tables[0];
        this.lstUsers.DataValueField = this.oUser.PrimaryKey;
        this.lstUsers.DataTextField = this.oUser.FullNameField;
        this.lstUsers.DataBind();
        return true;
    }
    return false;
}
>Also, when you are in security administration mode and you open the Control Security Configuration dialog, you cannot close the dialog using the close button without generating the following error:

Hmmm...if you turn off debugging it does actually close the form. I need to look further into this one.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Previous
Reply
Map
View

Click here to load this message in the networking platform