Hi,
I am creating a user using following code. i am using Kentico Ultimate Edition (v6.0.4297).
UserInfo user = new UserInfo();
user = UserInfoProvider.GetUserInfo(userNameTextBox.Text.Trim());
if (user == null )
{
user = new UserInfo
{
UserName = userNameTextBox.Text.Trim(),
FirstName = userFirstNameTextBox.Text.Trim(),
LastName = userLastNameTextBox.Text.Trim(),
Email = userEmailAddressTextBox.Text.Trim(),
FullName = userFirstNameTextBox.Text.Trim() + " " + userLastNameTextBox.Text.Trim(),
IsEditor = false,
Enabled = true
};
//Custom field UserPhoneNumber
user.SetValue("UserPhoneNumber", txtPhoneNumberField.Text.Trim());
// Set Password
UserInfoProvider.SetPassword(user, password);
UserInfoProvider.SetUserInfo(user);
}
The problem is, Its not storing the password. When I checked the user in the SiteManager then it says the password is not set for the user.
Other fields are getting set properly.
Is it a correct way to create a user and set the pasword. if not then please guide.
Else please let me know the solution for it.