Hello all,

I am pretty new to ASP and we are using ASP for logins for our PHP projects, we are using Active Directory LDAP. We can only connect to one container at a time. I have managed to create some code so switch containers but I cannot log in using this script. Using multiple memberships with no default provider throws an error. We are using the visual studio login object.

Is my code correct?

if (!isNumeric){
    //if login name has IS/
    if(Login1.UserName.Contains("IS/")){
        //remove IS/(not part of the username
        Login1.UserName.Replace("IS/", "");
        //switch to IS container
        Login1.MembershipProvider = "ADldap3";      
    }else{
        //switch to container 2 - which works
        Login1.MembershipProvider = "ADldap2";
    }
}

Solution

    if (!isNumeric){
        if(Login1.UserName.Contains("IS/")){
            string v = Login1.UserName.Replace("IS/", "");
            Login1.MembershipProvider = "ADldap3";
            Login1.UserName = v;    
        }else{
            Login1.MembershipProvider = "ADldap2";
        }
 } 
}

Can anyone tell me why you cannot modify an ASP object directly? PM me?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.