form based authentication Create User method?
I am new to Membership and role provider by asp.net
All the articles I saw are using static method of Membership calss (CreateUser method) to create a new user. I also want to use it but my form has some custom fields to be added to Users table. Ho开发者_开发百科w I should manage it ? deals with this data sepraetly ? If you suggest that it will have 2 calls to database. Please advice
Create a overload for CreateUser
method in your custom membership provider by adding additional parameters
public MembershipUser CreateUser(
string username,
string password,
string email,
string passwordQuestion,
string passwordAnswer,
bool isApproved,
Object providerUserKey,
DateTime birthday,
out MembershipCreateStatus status
)
Then in your page you can call it by
((CustomMembershipProvider)Membership.Provider).CreateUser(/*parameters to your custom method*/)
精彩评论