I am having trouble with handling multiple Membership Providers on one site.
I have a registration page that creates user and adds them to an AD domain. Before I had one membership provider and on the page I called
Membership.CreateUser(txtUsername.Text, txtPassword.Text)
which created the username based on the user inputs on the page.
However, I added another membership provider to the web.config so that the log in page can be used to log in from another AD. Now, my registration page will not work because (I assume) there is two membership providers?
How can I fix this? How do I specify which provider to use when I call Membership.CreateUser?
Thanks.
Edit:
The correct way to do this, as mentioned below is :
MembershipCreateStatus newStatus = new MembershipCreateStatus();
Membership.Providers["ProviderName"].CreateUser(txtUserName.Text, txtPassword.Text, null, null, null, true,null, out newStatus);
Thank you!