Unable to get list of roles

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John

    Unable to get list of roles

    Hi

    When I try to get a list of roles using

    RolesArray = Roles.GetAllRol es()

    the array returned is Nothing. However if I assign a user to a role as below

    Roles.AddUserTo Role(User.UserN ame, "Feedback")

    it works OK.

    How can I get the list of roles already in the membership system?

    Thanks

    Regards


  • Juan T. Llibre

    #2
    Re: Unable to get list of roles

    Try :

    string[] roles = CustomPrincipal .Roles;



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    =============== =============== ========
    "John" <info@nospam.in fovis.co.ukwrot e in message news:%23Bo1ofRu IHA.524@TK2MSFT NGP05.phx.gbl.. .
    Hi
    >
    When I try to get a list of roles using
    >
    RolesArray = Roles.GetAllRol es()
    >
    the array returned is Nothing. However if I assign a user to a role as below
    >
    Roles.AddUserTo Role(User.UserN ame, "Feedback")
    >
    it works OK.
    >
    How can I get the list of roles already in the membership system?
    >
    Thanks
    >
    Regards
    >

    Comment

    Working...