block the currently logged in / specific user from the system in (ASP.NET Membership)


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. MembershipUser user = Membership.GetUser(); //to block currently logged in user
  2.  
  3. MembershipUser user = Membership.GetUser("username"); //To block a specific user:
  4.  
  5. user.IsApproved = false;
  6. Membership.UpdateUser(user);

URL: http://www.heartysoft.com/post/2009/06/13/How-to-Programmatically-Logout-Disable-a-User-Account.aspx

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.