开发者

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*/)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜