Esempio n. 1
0
 private static MvcHtmlString GetControlGroup(Models.IClientControl widget, string id, string textKey, string defaultText, string controlMarkup, string controlsCss = "")
 {
     return(new MvcHtmlString(string.Format(
                                  "<div class=\"control-group\">" +
                                  "<label class=\"control-label\" for=\"{0}\">{1}</label>" +
                                  "<div class=\"controls {2}\">" +
                                  "   {3}" +
                                  "</div>" +
                                  "</div>",
                                  widget.GetId(id),
                                  HttpUtility.HtmlEncode(widget.GetText(textKey, defaultText)),
                                  controlsCss,
                                  controlMarkup)));
 }
Esempio n. 2
0
        public static MvcHtmlString DefinitionListItem(this HtmlHelper helper, Models.IClientControl widget, string labelKey, string defaultLabel, string id, string dataColumn, IEnumerable <SelectListItem> selectList, string inputCss = null, SelectListItem blankItem = null, string separator = null, string labelCss = null, string textCss = null)
        {
            var list = selectList.ToList(); //todo: minor little hack...

            if (blankItem != null)
            {
                list.Insert(0, blankItem);
            }
            return(new MvcHtmlString(string.Format("<dt class=\"{2}\" title=\"{0}\">{0}{4}</dt><dd class=\"{3}\">{1}</dd>", HttpUtility.HtmlEncode(widget.GetText(labelKey, defaultLabel)), helper.DropDownList(id, list, new { @class = inputCss, data_column = dataColumn }).ToString(), labelCss, textCss, separator)));
        }
Esempio n. 3
0
 public static MvcHtmlString UploadButtonControlGroup(this HtmlHelper helper, Models.IClientControl widget, string id, string textKey, string defaultText, string buttonTextKey, string defaultButtonText, string inputCss = null, string inputType = null)
 {
     //helper.RegisterScript("~/scripts/fileuploader.js", true);
     helper.RegisterWebReference("fileuploader");
     return(GetControlGroup(widget, id, textKey, defaultText,
                            string.Format("   <a class=\"btn {1}\" id=\"{0}\" >{2}</a>",
                                          widget.GetId(id), inputCss, HttpUtility.HtmlEncode(widget.GetText(buttonTextKey, defaultButtonText)))));
 }
Esempio n. 4
0
 public static MvcHtmlString DefinitionListItem(this HtmlHelper helper, Models.IClientControl widget, string labelKey, string defaultLabel, string text, string separator = null, string labelCss = null, string textCss = null)
 {
     return(new MvcHtmlString(string.Format("<dt class=\"{2}\" title=\"{0}\">{0}{4}</dt><dd class=\"{3}\">{1}</dd>", HttpUtility.HtmlEncode(widget.GetText(labelKey, defaultLabel)), text, labelCss, textCss, separator)));
 }