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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:29:22+00:00 2026-05-11T19:29:22+00:00

I derived a class from MembershipProvider in System.Web.Security with the following definition: public class

  • 0

I derived a class from MembershipProvider in System.Web.Security with the following definition:

   public class RedditMembershipProvider : MembershipProvider
    {

        public RedditMembershipProvider()
        {

        }
        public override int PasswordAttemptWindow
        {
            get { return 10; }
        }
        /* snip all the similar properties definition
                 */
    }

The issue is I want when the RedditMembershipProvider is instantiated, I want all the properties to be read from the web.config, not from the code definition above:

<membership defaultProvider="RedditMembershipProvider">
<providers>
<clear/>
<add name="RedditMembershipProvider" 
     type="RedditClone.Models.RedditMembershipProvider"
     PasswordAttemptWindow=20
   />
</providers>
</membership>

So when I call the PasswordAttemptWindow from the View, I should get 20, not 10. But now I am getting 10, not 20.

Any idea how to solve this problem?

  • 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-05-11T19:29:22+00:00Added an answer on May 11, 2026 at 7:29 pm

    Silly me! How can I make this kind of mistake?

    I just need to read web.config in my code to get the value out

      public override int PasswordAttemptWindow
        {
            get { ConfigurationManager.AppSettings["membership"].value; }
        }
    

    An even easier way is to inherit the RedditMembershipProvider from SqlMembershipProvider and override only necessary details.

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

Sidebar

Related Questions

i would like to get the type of the derived class from a static
Is there any way to get the Derived Class Name from static Keyword ?
I have a C# class derived from a generic list public class CostCodes :
In following code, in the derived class from ArrayList we are using a method
I have a derived derived class from an abstract class. The code is below.
I understand overriding a method/function redefines its implementation in the derived class from its
I'm trying to access the resources of a derived abstract class (from PhoneApplicationPage) in
I have a class derived from CTreeCtrl . In OnCreate() I replace the default
I have a class derived from Dictionary. I need this class to simulate a
i created a class derived from CheckedListBox so i can change item height as

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.