Error approving membership user

  • Thread starter Thread starter John
  • Start date Start date
J

John

Hi

I am trying to approve a user as below;

Dim User As MembershipUser
User = Membership.GetUser("MyUsername")
User.IsApproved = False

I am getting an "Object reference not set to an instance of an object."
error on the last line. What is the problem and how can I fix it?

Thanks

Regards
 
User = Membership.GetUser("MyUsername")

You are sure that this gives a user back?

Cor
 
If GetUser() is returning null, then there was probably no user found with
the specified username.
 
Back
Top