views:

917

answers:

1

I have a requirement for multiple Role Providers per website. What I'm not seeing is if/how to tell ASP.Net which provider to use (similar to the membership provider property on the login controls). I have a feeling that since this is done (I beleive) in an HTTP Module the role check may be occuring before the page life cycle ever begins - but I'm hoping someone gives me a different answer.

If I want to have multiple providers per website am I going to have to junk the configuration in web.config and perform the checks manually?

+1  A: 

The Providers property references all the role providers enabled for an application. You can control which provider you wish to use at runtime like this:

RoleProvider provider = Roles.Providers["MyRoleProvider"];
Phaedrus
Yes, I was hoping for something so to force the HttpModule which checks Roles to use a particular provider. I think I'm going to have to go this route though.
benjynito