Files
LeafWeb/WebCms/Views/Shared/EditorTemplates/Checkbox.cshtml
T
2020-08-04 21:40:32 -04:00

17 lines
515 B
Plaintext

@model string
@{
Layout = "_FieldLayout.cshtml";
var htmlAttributes = new RouteValueDictionary();
if (ViewBag.@class != null)
{
htmlAttributes.Add("class", ViewBag.@class);
}
var isChecked = !string.IsNullOrEmpty(Model);
var id = ViewData.TemplateInfo.GetFullHtmlFieldId("");
}
<input id="@id" name="@id" type="checkbox"
@if(isChecked) {<text>checked="checked"</text>}
@if(htmlAttributes.ContainsKey("class")){<text>class="@htmlAttributes["class"]"</text> } />