ASP.NET MEMBERSHIP USER LOCK BY C#
Islocked Method is read only property of membership user.
so we have to use alternatively method. it is same as isLocked method.
From below code we can lock the user from login. Once account has approved or
unlock after that user will log in .
MembershipUser Lockeduser = Membership.GetUser(newUserAccount.UserID.Value);
if (Lockeduser != null)
{
//disable online account
Lockeduser.IsApproved = false;
Membership.UpdateUser(Lockeduser);
}
please do not hesitate to comment .
Thanks
Vik Shah
http://dakvikas.webs.com
No comments :
Post a Comment