Ejemplo n.º 1
0
        protected virtual void CreateControlHierarchy()
        {
            //Load Item Style
            CssClass  = "dnnFormItem";
            CssClass += (FormMode == DnnFormMode.Long) ? "" : " dnnFormShort";

            if (String.IsNullOrEmpty(ResourceKey))
            {
                ResourceKey = DataField;
            }

            //Add Label
            var label = new DnnFormLabel
            {
                LocalResourceFile = LocalResourceFile,
                ResourceKey       = ResourceKey + ".Text",
                ToolTipKey        = ResourceKey + ".Help",
                ViewStateMode     = ViewStateMode.Disabled
            };

            if (Required)
            {
                label.RequiredField = true;
            }

            Controls.Add(label);

            WebControl inputControl = CreateControlInternal(this);

            label.AssociatedControlID = inputControl.ID;
            AddValidators(inputControl.ID);
        }
Ejemplo n.º 2
0
        protected virtual void CreateControlHierarchy()
        {
            //Load Item Style
            CssClass = "dnnFormItem";
            CssClass += (FormMode == DnnFormMode.Long) ? "" : " dnnFormShort";

            if (String.IsNullOrEmpty(ResourceKey))
            {
                ResourceKey = DataField;
            }

            //Add Label
            var label = new DnnFormLabel 
                                {
                                    LocalResourceFile = LocalResourceFile, 
                                    ResourceKey = ResourceKey + ".Text", 
                                    ToolTipKey = ResourceKey + ".Help"
                                };

            Controls.Add(label);

            WebControl inputControl = CreateControlInternal(this);
            label.AssociatedControlID = inputControl.ID;
            if(Required)
            {
                inputControl.CssClass += " dnnFormRequired";
            }

            Controls.Add(inputControl);

            AddValidators(inputControl.ID);
        }