@model int @{ var htmlAttributes = ViewData["htmlAttributes"] as Dictionary ?? new(); htmlAttributes.TryAdd("class", "form-control select2"); htmlAttributes.TryAdd("style", "width: 100%;"); htmlAttributes.TryAdd("data-dropdown-css-class", "select2-blue"); }
@Html.DropDownList("", ViewData["SelectList"] as IEnumerable, htmlAttributes)