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

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Populate Textbox from userPopulate Textbox from user's profile
Previous
 
Next
New Post
7/29/2008 10:55 AM
 

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.

 
New Post
7/29/2008 11:40 AM
 

In your code you declare oUserInfo as a new user info object, but you never hydrate it with the users current information.

Personally as long as your module control inherits from portalmodulebase, just use UserInfo.FirstName, UserInfo.LastName, and UserInfo.Email to get th evalues you need.  You can remove the declaration of the oUserInfo object.


-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
New Post
7/29/2008 11:47 AM
 

Ahh, of course.  I feel like a fool now.  Thank you, Mitch.  It works fine now.  I am much obliged.

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Populate Textbox from userPopulate Textbox from user's profile


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