Switch to using string instead of bool for checkbox values
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
@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>} />
|
||||
Reference in New Issue
Block a user