Example #1
0
        private IEnumerable<Control> RenderLabel(PanelItem panelItem)
        {
            var controls = new List<Control>();

            if (!panelItem.Label.IsNullOrEmpty())
            {
                var label = new Label { ID = panelItem.GetLabelId(), Text = ResourceManager.GetString(panelItem.Label), Visible = panelItem.Visible };

                label.AddStyle(CssClass.Label);

                controls.Add(label);
                panelItem.IDs.Add(label.ID);

                if (!panelItem.Optional)
                {
                    var asterix = new Label { ID = panelItem.GetLabelId() + "Asterix", Text = @" *", CssClass = "Mandatory", Visible = panelItem.Visible };

                    controls.Add(asterix);
                    panelItem.IDs.Add(asterix.ID);
                }
            }

            return controls;
        }