JPJedi
JPJedi

Reputation: 1508

ASP.Net membership validating users created manually

I am manually creating users in my asp.net user tables with the membership.creatuser(). Is there an easy way to test to make sure the account is created and or valid after I create it?

MembershipCreateStatus status = new MembershipCreateStatus();
Membership.CreateUser(user.FirstName + user.LastName, 
                       user.Password, user.Email);

I would basically like to do an auto sign in to the site and then return if it was successful or not?

Any links or ideas would be greatly appreciated.

Thanks

Upvotes: 1

Views: 1070

Answers (1)

Jon
Jon

Reputation: 4945

Well, the CreateUser() method has an out parameter that will return a MembershipCreateStatus enum with details about what happened. Anything other than Success from that enum indicates a potential problem.

I see you've declared your status variable, you just need to use it!

Upvotes: 3

Related Questions