Posted By

skhan on 08/23/10


Tagged

user block Membership


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Tyster


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


 / Published in: C#
 

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

  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);

Report this snippet  

You need to login to post a comment.