asp.net membership - MVC Multiple MembershipProviders - one of them WebSecurity -


i know how can switch between multiple membershipproviders, if of type membership, like:

  membershipprovider provider;   if ( username.text.startswith("g\")     provider = membership.providers["globalprovider"];   else     provider = membership.providers["standardprovider"];    if ( provider.validateuser( ... 

but have troubles if 1 of them websecurity provider, vs2012 uses in internet-template, instance of extendedmembershiprovider. use 1 membership/access administration-area of website, whereas rest of site uses third-party custom membershipprovider access of users other areas.

so think boils down question:

how can switch between instance membership , extendedmembership?

i find out current provider using

    // current provider     var provider = membership.provider;      // list of providers     var providers = membership.providers; 

you can check whether current provider derived extendedmembershipprovider or not using:

extendedmembershipprovider extendedmembershipprovider = membership.provider extendedmembershipprovider; 

not sure want, thought might useful you.


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo