0

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";
    }
}
1
Contributor
1
Reply
10
Views
3 Years
Discussion Span
Last Post by liamfriel
0

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?

Edited by liamfriel: Ask for clarification

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.