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 8429159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:15:27+00:00 2026-06-10T05:15:27+00:00

I am using code that inherits SqlMembershipProvider , named MyMembershipClass so that I can

  • 0

I am using code that inherits SqlMembershipProvider, named MyMembershipClass so that I can make use of the functions.

I have created my inherited class and specified it in the Web.config file like so:

<membership defaultProvider="MyMembershipClass">
  <providers>
    <clear/>
    <add name="MyMembershipClass" type="MyMembershipClass" applicationName="/"/> 
  </providers>
</membership>

Now that I have done that, to make use of the Membership functions, do I refer to it within my code as:

MyMembershipClass or just Membership?

EDIT:

If you refer to it at just Membership, is this due to defaultProvider="MyMembershipClass"?

  • 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-10T05:15:28+00:00Added an answer on June 10, 2026 at 5:15 am

    Just as Membership. It will automatically map to your defined membership class. That enables to change the provider later without needing to change all of your code.

    So you don’t have to write:

    MyMembershipClass.GetUser 
    

    but

    Membership.GetUser
    

    By the way, the same is true if you define a custom RoleProvider, for example:

    Roles.AddUserToRole(userName, roleName);  
    

    Edit:

    If you refer to it at just Membership, is this due to
    defaultProvider=”MyMembershipClass”?

    Yes, that must be the name of your class that inherits from MembershipProvider (or another class inheriting from it like SqlMembershipProvider).

    According to your second comment that you can define what you want even if it doesn’t exist, i get an exeption if i name the provider “Bob” in web.config:

    Exception information:
    Exception type: ConfigurationErrorsException
    Exception message: Default Membership Provider could not be found.

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

Sidebar

Related Questions

I have some code that is using SyncEnumerator. As you can see here ,
I have created a BasePage class that inherits from System.Web.Ui.Page. In that base class
I have a class that inherits the Actor trait. In my code, I have
I have some code using Lucene that leaves the default conjunction operator as OR,
.Net 3.5, using C# I have an instance of a class (A) that has
I have a Prim class that implements an IPrimitiveDecomposer interface for MEF and inherits
I have an interface for a base class, and every class that inherits from
I'm using wx.aui to build my user interface. I'm defining a class that inherits
I have a class that inherits a base class to which another class has
I'm having an error using a custom class that inherits from LruCache in Android.

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.