Setting a profile property in asp.net MVC while creating a user.
Posted
by twal
on Stack Overflow
See other posts from Stack Overflow
or by twal
Published on 2010-06-06T03:26:29Z
Indexed on
2010/06/06
3:32 UTC
Read the original article
Hit count: 249
c#
|asp.net-mvc
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
© Stack Overflow or respective owner