自定义 CreateUser 方法(带有附加参数)
我已经实现了自定义 MembershipProvider,现在我想使用 CreateUserWizard 来创建新用户。 问题是我想在数据库中存储更多通常的信息(例如名字和姓氏)。
有一个功能:
public override MembershipUser CreateUser(string username, string password, string email,
string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey,
out MembershipCreateStatus status)
{
throw new NotImplementedException();
}
我可以实现,但它不会存储名字等。
我在这里找到: http://forums.asp.net/t/1496795.aspx 解决方案,我可以重载此函数并手动调用它,但在这种情况下仍会调用默认的 CreateUser 函数...
i have implemented custom MembershipProvider and now i would like to use CreateUserWizard to create new users..
the problem is that i want to store in the db more information that normally (e.g. first and last name).
There is function:
public override MembershipUser CreateUser(string username, string password, string email,
string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey,
out MembershipCreateStatus status)
{
throw new NotImplementedException();
}
which i can implement but it won't store first name etc.
i found here: http://forums.asp.net/t/1496795.aspx solution that i can overload this function and call it manually but the default CreateUser function will still be called in this case...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
创建您自己的 UI,或者我认为您可以使用设计器覆盖默认模板,您可以说转换为模板,然后添加到此模板。不过,您必须自己调用这些方法...尝试利用控件的事件来调用正确的方法。
HTH。
Create your own UI or I think you can override the default template using the designer, you can say convert to template, and add to this template. You have to invoke the methods yourself though... Try tapping into the events of the control to call the correct methods.
HTH.