Domanda

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,

È stato utile?

Soluzione

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

Altri suggerimenti

I just responded the same question. Please take a look here

Hope this will help you

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top