tags:

views:

22

answers:

1

In my application, an authorized user will Register a new customer and set their username and password, etc. The customer will not be registering them self.

I have the following code in a class file which creates the new user, and it works just fine.

   public MembershipCreateStatus CreateUser(string userName, string password, string email, string employeeID)
    {
        if (String.IsNullOrEmpty(userName)) throw new ArgumentException("Value cannot be null or empty.", "userName");
        if (String.IsNullOrEmpty(password)) throw new ArgumentException("Value cannot be null or empty.", "password");
        if (String.IsNullOrEmpty(email)) throw new ArgumentException("Value cannot be null or empty.", "email");

        MembershipCreateStatus status;
       /// _membershipProvider.CreateUser("asdas","ds123BB", email, "asdasd", "asdasdad", true, null, out status);
        _membershipProvider.CreateUser(userName, password, email, null, null, true, null, out status);


        string answer = status.ToString();
        return status;
    }

However I would also like to set an employeeID property for the profile when creating this user.

how would I set the EmployeeID when creating a new user?? Thanks

A: 

You will need to write a custom membership provider. Here's a video and an article about how this could be accomplished.

Darin Dimitrov
I have already created a custom membership provider to store the data in my sqlserver. That part is working for the membership. I am not sure what you mention is my issue.
twal