How do you update the aspnetdb membership IsApproved value?
- by Matt
I need to update existing users IsApproved status in the aspnet_Membership table. I have the code below that does not seem to be working. The user.IsApproved property is updated but it is not saving it to the database table. Are there any additional calls I need to make? Any suggestions? Thanks.
/// <summary>
/// Updates a users approval status to the specified value
/// </summary>
/// <param name="userName">The user to update</param>
/// <param name="isApproved">The updated approval status</param>
public static void UpdateApprovalStatus(string userName, bool isApproved)
{
MembershipUser user = Membership.GetUser(userName);
if (user != null)
user.IsApproved = isApproved;
}