private bool ValidateRegistration(string userName, string email, string password, string confirmPassword)
{
if (String.IsNullOrEmpty(userName)) {
ModelState.AddModelError("username", Resources.Resources.YouMustSpecifyUsername);
}
if (String.IsNullOrEmpty(email)) {
ModelState.AddModelError("email", Resources.Resources.YouMustSpecifyEmailAddress);
}
if (password == null || password.Length < MembershipService.MinPasswordLength) {
ModelState.AddModelError("password",
String.Format(CultureInfo.CurrentCulture,
Resources.Resources.YouMustSpecifyLongerPassword,
MembershipService.MinPasswordLength));
}
if (!String.Equals(password, confirmPassword, StringComparison.Ordinal)) {
ModelState.AddModelError("_FORM", Resources.Resources.NewPasswordAndConfirmationMismatch);
}
return ModelState.IsValid;
}