提供的用户名无效

时间:2013-06-27 12:25:59

标签: c# facebook asp.net-mvc-4 asp.net-membership dotnetopenauth

我在MVC会员资格方面遇到了一个问题,这个问题让我很难过。我在Facebook上使用OAuth作为我的网站,除非;如果用户名(在这种情况下名称和姓氏)包含“i”,我在页面mysite / Account / ExternalLoginConfirmation收到该错误:

Server Error in '/' Application.

The username supplied is invalid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.Security.MembershipCreateUserException: The username supplied is invalid.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

为了更清楚,如果用户名是“Meta Brown”,如果用户名是“Hail Brown”或者我发现上面的错误,那就非常好了。

在mysite / Account / Register页面,如果我选择像“hail”这样的用户名,我就会感到惊讶:

The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.

当我通过Facebook注册时,如果用户名包含字符“i”我的webpages_OAuthMembership表保持为空,当我通过MVC会员系统注册时,我的webpages_Membership表保持为空。

我还为非拉丁字符添加了一个控件:

        [Required]
        [RegularExpression(@"^([a-zA-Z0-9]+)$", ErrorMessage = "Please use Latin characters only.")]
        [Display(Name = "User name")]
        public string UserName { get; set; }

1 个答案:

答案 0 :(得分:0)

您必须将userprofile表中的用户名字段更改为拉丁语。它应该解决问题。

它应该是这样的:

Latin1_General_CI_AS