Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Create User returns -1 for the UserIDCreate User returns -1 for the UserID
Previous
 
Next
New Post
10/31/2007 4:17 PM
 

Hello Everyone-

I created a new authentication provider and am trying to create a user through DNN, it appears that the user is being created, however, the userID that is being passed back is always -1. Thus the roles are not getting added correctly. I am using the UserController.CreateUser, is there something that I'm doing wrong? Without the roles I cannot get the user through GetUserByName either.

Not sure what I'm doing wrong but any feedback would be greatly appreciated.

Thanks!

Christina

 

 
New Post
10/31/2007 10:19 PM
 

If you download the beta of IWeb it has code to create users. PErhaps examining it would help.

 

here is a bit of the code:

            Dim oUserInfo As New UserInfo()
            oUserInfo.PortalID = PortalID
            oUserInfo.Membership.Username = NewUsername
            oUserInfo.Username = NewUsername
            oUserInfo.FirstName = FirstName
            oUserInfo.LastName = LastName
            oUserInfo.DisplayName = DisplayName
            oUserInfo.Membership.Email = email
            oUserInfo.Email = email
            oUserInfo.Membership.Approved = True
            oUserInfo.AffiliateID = Null.NullInteger
            oUserInfo.Membership.Password = Newpassword

            Dim objUserCreateStatus As Security.Membership.UserCreateStatus = CreateUser(oUserInfo)

            If objUserCreateStatus = Security.Membership.UserCreateStatus.Success Then
                objResponse = "Success"
            Else
                objResponse = [String].Format("Error: {0}", objUserCreateStatus.ToString())
            End If

        Public Shared Function CreateUser(ByVal objUserInfo As UserInfo) As Security.Membership.UserCreateStatus
            Return UserController.CreateUser(objUserInfo)
        End Function



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
11/1/2007 12:25 PM
Accepted Answer 

Thank you for your help! I must not have been assigning all the values that were needed. It's working great now.

Thanks!
Christina

 
New Post
11/12/2007 9:50 AM
 

Thanks Michael Washington,

I had the same problem and i was stuck to it from three days.

i just tried the above code and wow everything is working great.

Thanks a lot.it helped me a lot.

Thanks,

Amol

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Create User returns -1 for the UserIDCreate User returns -1 for the UserID


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out