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!
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!
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.
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;
}
}
}