I am registering a user manually, without the registration or custom registration webpart from kentico. These two things are not an option for this project. I want to enable the user after They are registered and created in the database. Registration is successful. I am using ui.Enabled = true. but it is not enabling the user when I redirect to the next page.
ui.SetValue("FirstName", txtGivenName.Text);
ui.SetValue("LastName", txtFamilyName.Text);
ui.SetValue("FullName", txtGivenName.Text + " " + txtFamilyName.Text);
ui.SetValue("UserName", txtUsername.Text);
ui.SetValue("Email", txtEmail.Text);
ui.SetValue("Phone", txtPhone.Text);
ui.SetValue("DOB", _dob);
ui.SetValue("Citizenship", _citizenship);
ui.SetValue("Gender", _gender);
UserInfoProvider.SetUserInfo(ui);
UserInfoProvider.SetPassword(ui, txtPassword.Text);
UserSiteInfoProvider.AddUserToSite(ui.UserID, CMSContext.CurrentSite.SiteID);
ui.Enabled = true;