Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7856701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:47:42+00:00 2026-06-02T20:47:42+00:00

MembershipProvider has methods public abstract MembershipUser GetUser( Object providerUserKey, bool userIsOnline ) to look

  • 0

MembershipProvider has methods

public abstract MembershipUser GetUser(
    Object providerUserKey,
    bool userIsOnline
)

to look up users by their unique identifier. This is useful if you want to have you own database and associate some objects of yours to certain memberships.

Can you do the same with RoleProvider ? There doesn’t seem to be any methods to map roles to their unique identifier or vice versa.

As a side note is it a good idea to just add your own tables to the asp.net sql database or is it better to have a separate database for your own objects and have foreign keys into the asp.net sql membership table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T20:47:45+00:00Added an answer on June 2, 2026 at 8:47 pm

    There is no way within the API to return a role from an ID – you can get all roles via

    Roles.GetAllRoles();
    

    Or you can get all roles for a user by

    Roles.GetRolesForUser(userName);
    

    But not a single role.

    I would guess the reason for this is that roles on there own are probably not that useful (at least as far as Microsoft are concerned).

    Of course roles are just a table within the database so you can easily add this functionality yourself with some straight SQL – it will just take a little more work.

    In terms of additional data – I normally create my own tables within the same database with foreign keys as you have suggested above. Although if you have not heard of Profile Provider (http://msdn.microsoft.com/en-us/library/0580x1f5.aspx) you may want to look into that as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an C# asp.net app using the default Sql MembershipProvider. My web.config has
I am using Oracle.Web.Security.OracleMembershipProvider MembershipProvider for my ASP.NET application. My login form has username,
I am extending the MembershipUser and MembershipProvider classes. I am using an ORM. I
I would like users to login to my site using only their Facebook credentials.
Is it possible to create a custom MembershipProvider without the use of the MembershipUser
I have implemented Membership Provider in my ASP.NET MVC app. Membership provider has the
I am creating a custom membership provider for a web app that already has
I'm using the ASP.NET SQL Membership Provider. So, there's an aspnet_Users table that has
I have a custom MembershipProvider and a custom RoleProvider. I created the custom MembershipProvider
Hi I use a custom MembershipProvider. I want to know the current username during

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.