Search code examples
c#asp.netmembership-providercustom-membershipprovider

Get user group in Membership.ValidateUser


I'm using Form Authentication and Membership provider. When I call Membership.ValidateUser(logon.UserName,logon.Password), it's only returning a boolean which indicates whether this user is valid. But I want the User to be returned. How can I do that?


Solution

  •         string userName = "someuser";
            string password = "";
            MembershipUser user = null;
            if (Membership.ValidateUser(userName,password))
            {
                user = Membership.GetUser(userName);
            }