how to add properties to sql membership provider for registering users
-
29-06-2021 - |
Question
I'm using sql membership provider and I'm wanting to add Shipping information when users register... The user is required to enter shipping info. What is the best way to approach this / how do I do it if possible?
public class RegisterModel
{
[Required]
[Display(Name = "User name")]
public string UserName { get; set; }
[Required]
[DataType(DataType.EmailAddress)]
[Display(Name = "Email address")]
public string Email { get; set; }
[Required]
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
[DataType(DataType.Password)]
[Display(Name = "Password")]
public string Password { get; set; }
[DataType(DataType.Password)]
[Display(Name = "Confirm password")]
[Compare("Password", ErrorMessage = "The password and confirmation password do not match.")]
public string ConfirmPassword { get; set; }
}
Thanks,
La solution
Membership provider is only for basic info. ASP.NET also has something like ProfileProvider. The out-of-the-box version shipped with ASP.NET stores information in XML in database along with the data of Membership Provider.
Classic tutorial: http://www.4guysfromrolla.com/articles/101106-1.aspx
Autres conseils
I just responded the same question. Please take a look here
Hope this will help you
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow