Switch to using string instead of bool for checkbox values
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
@model Boolean?
|
||||
|
||||
@{
|
||||
Layout = "_FieldLayout.cshtml";
|
||||
|
||||
var htmlAttributes = new RouteValueDictionary();
|
||||
if (ViewBag.@class != null)
|
||||
{
|
||||
htmlAttributes.Add("class", ViewBag.@class);
|
||||
}
|
||||
}
|
||||
|
||||
@if (Model.HasValue && Model.Value)
|
||||
{
|
||||
<input id="@ViewData.TemplateInfo.GetFullHtmlFieldId("")" name="@ViewData.TemplateInfo.GetFullHtmlFieldId("")"
|
||||
type="checkbox" checked="checked" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<input id="@ViewData.TemplateInfo.GetFullHtmlFieldId("")" name="@ViewData.TemplateInfo.GetFullHtmlFieldId("")"
|
||||
type="checkbox" />
|
||||
}
|
||||
Reference in New Issue
Block a user