Esempio n. 1
0
        public static MvcHtmlString JQM_FlipSwitch(this HtmlHelper htmlHelper, FlipswitchConfig config)
        {
            TagBuilder tag = new TagBuilder("input");

            config.Configuration.Add("type", "checkbox");
            config.Configuration.Add("data-role", "flipswitch");
            config.SetAttributes(tag);
            return(new MvcHtmlString(tag.ToString(TagRenderMode.SelfClosing)));
        }
Esempio n. 2
0
        public static MvcHtmlString JQM_CheckBoxFor <TModel>(this HtmlHelper <TModel> htmlHelper, Expression <Func <TModel, bool> > expression, FlipswitchConfig config)
        {
            TagBuilder tagResult = new TagBuilder("div");

            tagResult.MergeAttribute("class", "ui-field-contain");
            config.Configuration.Add("data-role", "flipswitch");
            tagResult.InnerHtml += InputExtensions.CheckBoxFor <TModel>(htmlHelper, expression, config.GetAttributes()).ToHtmlString();
            tagResult.InnerHtml += ValidationExtensions.ValidationMessageFor(htmlHelper, expression).ToHtmlString();
            return(tagResult.ToHtml());
        }