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 ...Modify Profile - Add Birthday FieldModify Profile - Add Birthday Field
Previous
 
Next
New Post
8/9/2006 6:50 PM
 

Hi, I am trying to add a birthday column to the profile. I figured i need to login as host and add a datatype of type Date. However, i don't know what controls to associate that type with. Is there a DNN Calendar controls (like the one used for date fields in the core modules)? If so, can i get the namespace for it.

Help would be appreciated.

Thanks

 
New Post
8/10/2006 12:42 PM
 
i needed similar functionality. 

i first added 3 dropdownlists to my form then bound them like this:


            Dim colMonth As Lists.ListEntryInfoCollection = objListController.GetListEntryInfoCollection("Month", "")
            ddlMonth.DataSource = colMonth
            ddlMonth.DataBind()
            ddlMonth.Items.Insert(0, New ListItem("<Month>", ""))

            ddlDay.Items.Insert(0, New ListItem("<Day>", ""))
            Dim iDays As Integer
            For iDays = 1 To 31
                ddlDay.Items.Insert(iDays, New ListItem(iDays.ToString()))
            Next

            Dim arrYears As New ArrayList
            Dim iYear As Integer
            For iYear = (Today.Year - 100) To Today.Year
                arrYears.Add(iYear)
            Next
            arrYears.Reverse()
            ddlYear.DataSource = arrYears
            ddlYear.DataBind()
            ddlYear.Items.Insert(0, New ListItem("<Year>", ""))



i then needed to validate the selections.

        Private Sub valDOB_ServerValidate(ByVal source As System.Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles valDOB.ServerValidate
            Try
                If ddlMonth.SelectedIndex > 0 And ddlDay.SelectedIndex > 0 And ddlYear.SelectedIndex > 0 Then
                    Dim iMonth As Integer = CType(ddlMonth.SelectedValue, Integer)
                    Dim iDate As Integer = CType(ddlDay.SelectedValue, Integer)
                    Dim iYear As Integer = CType(ddlYear.SelectedValue, Integer)

                    Dim dob As New System.DateTime(iYear, iMonth, iDate)
                    Dim age As Integer = CType(DateDiff("yyyy", dob, Date.Today()), Integer)

                    If age > 13 Then
                        _dob = dob
                        args.IsValid = True
                    Else
                        valDOB.ErrorMessage = "<br>Underage.  Must be 13 years old or older."
                        args.IsValid = False
                    End If
                Else
                    args.IsValid = False
                End If

            Catch exc As Exception    'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub


then add to userprofile.


objUserInfo.Profile.SetProfileProperty("DOB", _dob)

UserController.UpdateUser(PortalId, objUserInfo)

i hope this helps.

 
New Post
8/10/2006 3:47 PM
 
you might use a text box, as users usually don't need a calendar to type in their birthdays.

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Modify Profile - Add Birthday FieldModify Profile - Add Birthday Field


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