Hi all!
I'm relatively new to DNN and now I have my first problem that I can't fix. I simply can't update user info. To make it really simple I only try to update first name. I get no error message but user info doesn't update. I've tried to search tutorials and forums but I can't find any answers to my problem. Maybe I'm just blind..
I have ascx file with one textBox, one button and one RequiredFieldValidator. Here's parts of my vb code:
Imports DotNetNuke
Imports DotNetNuke.Entities.Users
Imports System.Web.UI
Imports System.Collections.Generic
Imports System.Reflection
...
...
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
Try
If Page.IsValid Then
Dim cUser As New UserController
Dim iUser As UserInfo = cUser.GetUser(Me.PortalId, Me.UserId)
iUser.FirstName = Me.txtFirstName.Text
iUser.Profile.SetProfileProperty("FirstName", Me.txtFirstName.Text)
UserController.UpdateUser(Me.PortalId, iUser)
End If
Catch exc As Exception
ProcessModuleLoadException(Me, exc)
End Try
End Sub
If I use same code but instead of iUser.FirstName = Me.txtFirstName.Text I put iUser.FirstName = "MyName" the FirstName property does update. I have this same problem with DNN 3.7.7 and 4.5.5. I'm sure there is a simple way to solve this problem but I can't find it out.. Maybe my portal settings are wrong or I don't import all necessary items or something.
It would be nice if someone could tell me what I do wrong. And it would be even better if someone could point me a good tutorial of updating user.
Thanks!