简体   繁体   English

是否可以更改asp.net成员资格提供程序的用户名类型?

[英]Is it possible to change username types for asp.net membership provider?

Is it possible to change the way users create accounts for an SQL membership provider, so that users have to sign up with their email as their username? 是否可以更改用户为SQL成员资格提供程序创建帐户的方式,以便用户必须使用电子邮件作为用户名进行注册? I know by default users can make their username in email format but then it still asks for the email address twice ontop of the username which makes it a little redundant. 我知道默认情况下,用户可以将用户名设置为电子邮件格式,但是它仍然要求在用户名的顶部两次输入电子邮件地址,这使用户名有些多余。

Just don't ask the user his UserName while registering. 只是不要在注册时询问用户其UserName Ask the Email address and pass email address in place of UserName in CreateUser() method. CreateUser()方法中询问电子邮件地址并传递电子邮件地址代替UserName

Membership.CreateUser(PASSEMAILIDHERE, model.Password, model.Email, null, null, true, null, out createStatus);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM