Reputation: 14888
Is there a way to obtain a specific membership provider?
When you make calls to the static Membership
methods they query whatever provider you have configured as the defaultProvider
. Is it possible to get a reference to a specific provider that is configured in your web.config and query against only that provider?
Upvotes: 9
Views: 1882
Reputation: 16680
Yes, if you have multiple providers configured in your web.config, you can look them up by name.
MembershipProvider membershipProvider = Membership.Providers["foo"];
Upvotes: 11