BootstrapComponents.Core.HtmlAttributes.ToDictionary C# (CSharp) Метод

ToDictionary() публичный Метод

public ToDictionary ( ) : object>.IDictionary
Результат object>.IDictionary
        public IDictionary<string, object> ToDictionary()
        {
            return _attributes.ToDictionary(x => x.Key, x => (object)x.Value.ToString());
        }

Usage Example

Пример #1
0
 private void Init(HtmlHelper html, string actionName = null, string controllerName = null, object routeValues = null,
                   FormMethod method = FormMethod.Post, object htmlAttrs = null, FormType? formType = null)
 {
     var attrs = new HtmlAttributes(htmlAttrs);
     if (formType != null) attrs["class"] += "form-" + formType.ToString().ToLower();
     if (html == null) return;
     _form = html.BeginForm(actionName, controllerName, new RouteValueDictionary(routeValues), method, attrs.ToDictionary());
 }