Switching RoleProviders at runtime

Last post 02-20-2007 1:30 PM by FerVitale. 1 replies.

Sort Posts:

  • Switching RoleProviders at runtime

    02-20-2007, 11:14 AM
    • Loading...
    • luisetxe
    • Joined on 10-26-2005, 8:30 PM
    • Posts 12

    Hi,

    I have an application that is using a Menu control with securityTrimming enabled. I understand ( but I might be wrong here!) that this control uses the default Role provider in the web.config to determine what to show and what not, according to the roles the user belongs to.

    I wrote my own custom Role provider, and everything works fine when I manually  especify the provider as the defaultProvider in the roleManager section of the web.config file 

    <

    roleManager enabled="true" defaultProvider="LDAPRoleProvider">
       <
    providers>
             ...

     Well. Here is my problem. I need to be able to switch AT RUNTIME which RoleProvider  the Menu control uses. The Menu control only exposes a read only property to show which provider is using.

    How can I change dynamically the default Membersip provider? Or, how can I tell the Menu control, at runtime,  what provider to use?

     

     It has been a full day already that I spent with this, so any help it would be highly appreciatted..

    Thanks.

     

    luisetxe
  • Re: Switching RoleProviders at runtime

    02-20-2007, 1:30 PM
    • Loading...
    • FerVitale
    • Joined on 02-16-2007, 3:29 PM
    • Buenos Aires
    • Posts 184

    Hi there,

                  I found a link that can be helpful http://weblogs.asp.net/scottgu/archive/2006/11/20/common-gotcha-don-t-forget-to-clear-when-adding-providers.aspx#1053735

     

    Regards,

    Fernando

Page 1 of 1 (2 items)
Microsoft Communities
Page view counter