How to get/set MembershipUser status?

R

rh

Hi,

The asp.net 2.0 Web Site Admin Tool allows me to check/uncheck the "Active"
status for each user.

How can I do this programatically? I thought it would be in the
MembershipUser class but I could find no such property or method to do so.

Thanks in advance.
 
C

chris

After looking at the database, I do not see a Active flag in any of the
membership tables. I think you need to use the IsApproved flag
instead.

MembershipUserCollection users = Membership.GetAllUsers();
MembershipUser user = users["foo"];
user.IsApproved = false;

Chris
 
R

rh

Thanks.

Yes, it does appear that the IsApproved flag in the database matches the
"Active" checkbox value in the Web Site Administration Tool.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top