Basic forms support.

This commit is contained in:
2015-06-02 21:30:35 +02:00
parent 53123e3dc8
commit 76ac27a96c
3 changed files with 113 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Scrummer.Code.Controls;
namespace Scrummer.Code.Pages
{
public class FormUtils
{
public static Control CreateField(string label, Control fieldControl)
{
Panel pnlRow = new Panel();
pnlRow.CssClass = "formRow";
Panel pnlLabelContainer = new Panel();
pnlLabelContainer.CssClass = "formLabel width25pc";
pnlRow.Controls.Add(pnlLabelContainer);
if (string.IsNullOrEmpty(label) == false)
{
CLabel lblField = new CLabel();
lblField.Text = label;
pnlLabelContainer.Controls.Add(lblField);
}
Panel pnlFieldContainer = new Panel();
pnlFieldContainer.CssClass = "formField width75pc";
pnlRow.Controls.Add(pnlFieldContainer);
pnlFieldContainer.Controls.Add(fieldControl);
return pnlRow;
}
}
}