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.0Customizing registration page adding more questionsCustomizing registration page adding more questions
Previous
 
Next
New Post
4/21/2008 3:03 PM
 

I am new to DNN and I have to add custom fields(More questions ) to registration fields. User Info saving correctly in database and when saving answer in userprofile table I am getting error is Object reference not set to an instance of an object.

I have added answer1, answer2, answer3, answer4, answer5 in profilepropertydefinition table using manage profile properties link.

Please help me on this regard.

Below is the code I am trying

---Saving User Info

Dim oUserInfo As New UserInfo()
oUserInfo.Profile.InitialiseProfile(Me.PortalId)
oUserInfo.Membership.Username = txtPreferredUsername.Text
oUserInfo.Username = txtPreferredUsername.Text
oUserInfo.FirstName = txtFirstName.Text
oUserInfo.LastName = txtLastName.Text
oUserInfo.Membership.Email = txtEmailAddress.Text
oUserInfo.Email = txtEmailAddress.Text
oUserInfo.Membership.Approved = True
oUserInfo.Membership.Password = txtPassword.Text
UserController.CreateUser(oUserInfo)

---Saving questions in Userprofile table

Dim objUserController As New UserController
Dim objUserInfo As New UserInfo
objUserInfo = UserController.GetUserByName(Me.PortalId, oUserInfo.Username, False)
objUserInfo.Profile.SetProfileProperty("Answer1", txtAnswer1.Text)
objUserInfo.Profile.SetProfileProperty("Answer2", txtAnswer2.Text)
objUserInfo.Profile.SetProfileProperty("Answer3", txtAnswer3.Text)
objUserInfo.Profile.SetProfileProperty("Answer4", txtAnswer4.Text)
objUserInfo.Profile.SetProfileProperty("Answer5", txtAnswer5.Text)
UserController.UpdateUser(Me.PortalId, objUserInfo)

 Thanks

Naveen

 

 

 
New Post
5/1/2008 10:36 AM
 

I am getting stuck at the same point in my coding. Custom Property is not storing values with the following command

objUserInfo.Profile.SetProfileProperty("CompanyName", txtCompanyName.Text)

any help will be appriciated

 

Thanks

Aleem

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Customizing registration page adding more questionsCustomizing registration page adding more questions


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