Hi,
I'm trying to populate some textboxes within a module with the First Name, Last Name, and email address in the user's profile, but I'm not having much luck. I would think it would be simple, but I'm just gettting nowhere. Here is the code I've written, thinking it should work. Can anyone provide some insight? It'd be greatly appreciated.
This is written in the codebehind of the module I've created. The module contains a formview with some textboxes and checkboxes that the customer fills out and submits to a database.
Private Sub fvHIPAA_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles fvHIPAA.Load
Dim oUserInfo As New UserInfo
oUserInfo.PortalID = 0
Dim name As TextBox = CType(fvHIPAA.FindControl("name"), TextBox)
Dim email As TextBox = CType(fvHIPAA.FindControl("email"), TextBox)
name.Text = oUserInfo.Profile.FirstName & " " & oUserInfo.Profile.LastName
email.Text = oUserInfo.Email
End Sub
Seeing as the UserInfo object doesn't seem to be containing anything, I imagine its because I'm not accessing the profile correctly, but I'm just not sure what to do.