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

  • Home
  • SEARCH
  • 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 8505387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:18:13+00:00 2026-06-11T02:18:13+00:00

I am working with ASP.NET Membership Providers. I am using SqlMembership Provider, I have

  • 0

I am working with ASP.NET Membership Providers. I am using SqlMembership Provider, I have overriden the CreateUser class as shown below.

As you can see I have a SportDetails fields which contains many values, this I want to use in the CreateUser method. How do I pass these values ? since these values are taken from ViewModel. Infact SportDetails is my viewModel for registration page.

public class CustomMembershipProvider : SqlMembershipProvider
{
    public SportsDetails SportsDetails { get; set; }

    public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)
    {
        string.empty
        MembershipUser membershipUser = base.CreateUser(username, password, "", null,null, false, null, out status);

        // here is where I want to be able to use the value from Sports Details.

        return membershipUser;
    }
}

and my web.config

<membership defaultProvider="CustomMembershipProvider">
<providers>
    <clear/>        
    <add name="CustomMembershipProvider" type="Service.Security.CustomMembershipProvider" connectionStringName="my_db" requiresQuestionAndAnswer="false" enablePasswordRetrieval="false" enablePasswordReset="true" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="3" minRequiredNonalphanumericCharacters="0" passwordFormat="Clear" passwordAttemptWindow="10" applicationName="myApp" />
</providers>
</membership>

Please help me out on this.

  • 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-11T02:18:15+00:00Added an answer on June 11, 2026 at 2:18 am

    Found the answer the hard way 😉

    I used Interface for this.

    below is my interface used.

    public interface ISportsDetailer{
    
    public SportDetails SportsDetails { get; set; }
    
    }
    

    and then in my custom provider I had this Interface implemented as

    public class CustomMembershipProvider : SqlMembershipProvider, ISportsDetailer
    {}
    

    and to call CreateUser and pass these values before it, I used

    ((ISportsDetailer)Membership.Provider).SportsDetails = valueFromModel;
    

    Hope this helps some one in future 🙂

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

Sidebar

Related Questions

I have one asp.net web application. It is using two membership provider. Two sign-in
I m newb in asp.net. I m working for an example with Membership class
We are using ASP.Net Membership provider for user management module in our WPF based
I'm working with a custom asp.net membership provider in conjunction with the default Account
I am working on asp.net membership website. I created the membership provider automatically, and
I am using asp.net membership provider with mysql and iis7, and had no problem
I have an ASP.NET web project and a membership provider configured via my web.config.
I'm using the default ASP.NET profile and membership provider. I want to create a
I'm working on a custom implementation of ASP.NET membership, which uses my own database
I'm working on a small website and I want to include the Asp.Net Membership

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.