Hi,
I am using below code to create user progmatically:
objUser.AffiliateID = DotNetNuke.Common.Utilities.Null.NullInteger;
objUser.FirstName = "First Name";
objUser.LastName = "Last Name";
objUser.Username = "Username";
objUser.DisplayName = "Displayname";
objUser.Email = "emailid";
objUser.IsDeleted = false;
objUser.IsSuperUser = false;
objUser.PortalID = this.PortalId;
UserMembership objMembership = new UserMembership();
objMembership.Approved = true;
objMembership.CreatedDate = DateTime.Now;
objMembership.IsOnLine = false;
objMembership.Password = "password";
objUser.Membership = objMembership;
objUser.Profile.PreferredLocale = PortalSettings.DefaultLanguage;
objUser.Profile.PreferredTimeZone = PortalSettings.TimeZone;
objUser.Profile.FirstName = "First Name";
objUser.Profile.LastName = "Last Name";
objUser.Profile.Website = "www.abc.com";
objUser.Profile.Street = "Address";
objUser.Profile.Unit = "Unit";
objUser.Profile.City = "City";
objUser.Profile.Region = "State";
objUser.Profile.Country = "Country";
objUser.Profile.PostalCode = "Postal Code";
var userStatus = UserController.CreateUser(ref objUser);
User created successfully.
But when i try to get user information by userid. then not getting profile related information.
UserInfo objUserDetail= UserController.GetUserById (this.PortalId, 2);
I am not getting profile data. I also checked UserProfile table there record exists related to profile.
When i create user using DNN User then i am getting profile information.
Kindly let me know that what i am doing wrong.
Regards,