views:

223

answers:

2

I want to customize the parameter in createuser() method Membership Provider,

Actually, i have my own data store for users with different data including username,password.

but, the createuser() is not suite with my data

Any one can help me!

+1  A: 

As long as your provider is the only one in use, you don't need to call your CreateUser method through ASP.NET at all. Just create the method anywhere and call it normally.

Matti Virkkunen
Thanks, if we are going to use own data store, do we need to use membership provider
Sarathi1904
+2  A: 

You can do something like this.

using System;

namespace SampleApplication.Models
{
    using System.Web.Security;

    public class SampleMembershipUser : MembershipUser
    {
        public int UserLevelId { get; set; }

        public string FirstName { get; set; }

        public string LastName { get; set; }

        public string ApplicationName { get; set; }

        public Guid UserId { get; set; }

        public TASMembershipUser(
            string providername,
            string username,
            object providerUserKey,
            string email,
            string passwordQuestion,
            string comment,
            bool isApproved,
            bool isLockedOut,
            DateTime creationDate,
            DateTime lastLoginDate,
            DateTime lastActivityDate,
            DateTime lastPasswordChangedDate,
            DateTime lastLockedOutDate,
            int userLevelId,
            string firstName,
            string lastName,
            string applicationName,
            Guid userId) :
            base(
                providername,
                username,
                providerUserKey,
                email,
                passwordQuestion,
                comment,
                isApproved,
                isLockedOut,
                creationDate,
                lastLoginDate,
                lastActivityDate,
                lastPasswordChangedDate,
                lastLockedOutDate)
        {
            UserLevelId = userLevelId;
            FirstName = firstName;
            LastName = lastName;
            ApplicationName = applicationName;
            UserId = userId;
        }
    }
}
Michael Wheeler