Example #1
0
        private void AddProperty(ProfilePropertyDefinition property)
        {
            var           controller = new ListController();
            ListEntryInfo imageType  = controller.GetListEntryInfo("DataType", "Image");

            if (property.DataType != imageType.EntryID)
            {
                DnnFormEditControlItem formItem = new DnnFormEditControlItem
                {
                    ID                      = property.PropertyName,
                    ResourceKey             = String.Format("ProfileProperties_{0}", property.PropertyName),
                    LocalResourceFile       = "~/DesktopModules/Admin/Security/App_LocalResources/Profile.ascx.resx",
                    ValidationMessageSuffix = ".Validation",
                    ControlType             = EditorInfo.GetEditor(property.DataType),
                    DataMember              = "Profile",
                    DataField               = property.PropertyName,
                    Visible                 = property.Visible,
                    Required                = property.Required
                };
                //To check if the property has a deafult value
                if (!String.IsNullOrEmpty(property.DefaultValue))
                {
                    formItem.Value = property.DefaultValue;
                }
                if (!String.IsNullOrEmpty(property.ValidationExpression))
                {
                    formItem.ValidationExpression = property.ValidationExpression;
                }
                userForm.Items.Add(formItem);
            }
        }
Example #2
0
        private void AddProperty(ProfilePropertyDefinition property)
        {
            var           controller = new ListController();
            ListEntryInfo imageType  = controller.GetListEntryInfo("DataType", "Image");

            if (property.DataType != imageType.EntryID)
            {
                DnnFormEditControlItem formItem = new DnnFormEditControlItem
                {
                    ResourceKey       = String.Format("ProfileProperties_{0}", property.PropertyName),
                    LocalResourceFile = "~/DesktopModules/Admin/Security/App_LocalResources/Profile.ascx.resx",
                    ControlType       = EditorInfo.GetEditor(property.DataType),
                    DataMember        = "Profile",
                    DataField         = property.PropertyName,
                    Visible           = property.Visible,
                    Required          = property.Required
                };
                userForm.Items.Add(formItem);
            }
        }