473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to get/set MembershipUser status?

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.
Jan 30 '06 #1
2 1470
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

Jan 30 '06 #2
rh
Thanks.

Yes, it does appear that the IsApproved flag in the database matches the
"Active" checkbox value in the Web Site Administration Tool.
<ch***@cubed-c.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
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

Jan 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: brett_fyisystems | last post by:
I'm trying to implement an inherited MembershipUser class for a custom MembershipProver for RTM ASP.NET 2.0 I'm using an external assembly that implements these classes. I've signed the...
8
by: Mark Olbert | last post by:
I'm writing a custom MembershipProvider which uses a custom class derived from MembershipUser (basically, the derived class adds a field to the MembershipUser base class). When I try to configure...
9
by: Mark Olbert | last post by:
I'm reposting this in case it got lost... The ASPNET Configuration tool does not appear to be able to handle derived MembershipUser classes. Even the simplest possible derived class (one which...
0
by: mark d. | last post by:
I've been working through the new features in 2.0 for about a month now, am at the point of trying to apply them to my e-comerce applications. My apps assign a unique custid field in tracking the...
3
by: Linn | last post by:
Hi, I am trying to update the e-mail for å user (as an admin), but the new e-mail address is not saved. The msgbox gives met he correct email, but when I reload my data in the gridview, the old...
1
by: Smokey Grindle | last post by:
Im trying to write a custom membership provider but in the GetUser method it returns a MembershipUser, but when i create an object called that it says overload resolution failed... no accessable...
2
by: Cliff | last post by:
Hi, i try to get the emailaddress of an membershipuser: Dim a As MembershipUser Dim em As String em = a.Email.ToString In runtime, i get the error: "Object reference not set to an...
3
by: Jeff | last post by:
Hey ASP.NET 2.0 I'm trying to extend the MembershipUser class, and have encounter a problem: << See in the middle of this post for info about why I do this >> << See below of this post for...
0
by: =?Utf-8?B?TmVhbA==?= | last post by:
I have developed a simple membershipuser class and membershipprovider class. I basically followed the procedures referenced at http://msdn.microsoft.com/en-us/library/44w5aswa.aspx and made it even...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.