Check if user is in Role

Discussion in 'ASP .Net' started by shapper, Dec 13, 2006.

  1. shapper

    shapper Guest

    Hello,

    I need to check if a user with a certain username is in a specific
    role.
    This is not the current user which is logged on.

    How can I do this?

    Thanks,
    Miguel
     
    shapper, Dec 13, 2006
    #1
    1. Advertising

  2. If your using the membership api, the Roles class has a IsUserInRole method
    to do exactly this. It has an overload which takes two parameters, the first
    being the username and the second being the role in question.


    --

    Hope this helps,
    Mark Fitzpatrick
    Former Microsoft FrontPage MVP 199?-2006



    "shapper" <> wrote in message
    news:...
    > Hello,
    >
    > I need to check if a user with a certain username is in a specific
    > role.
    > This is not the current user which is logged on.
    >
    > How can I do this?
    >
    > Thanks,
    > Miguel
    >
     
    Mark Fitzpatrick, Dec 14, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jesper Stocholm
    Replies:
    2
    Views:
    8,213
    John Saunders
    Aug 23, 2003
  2. Liet Kynes
    Replies:
    0
    Views:
    527
    Liet Kynes
    Nov 26, 2003
  3. Annie
    Replies:
    2
    Views:
    362
    Annie
    Mar 6, 2007
  4. Kursat
    Replies:
    1
    Views:
    334
    Dominick Baier
    May 7, 2007
  5. Bob Sanders
    Replies:
    6
    Views:
    213
    Jacob Basham
    Nov 10, 2007
Loading...

Share This Page